swatchkit 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/build.js +8 -8
- package/package.json +1 -1
- package/src/layout.html +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ my-project/
|
|
|
28
28
|
├── css/
|
|
29
29
|
│ ├── compositions/ # Layout primitives (flow, sidebar, etc.)
|
|
30
30
|
│ ├── tokens.css # Generated from tokens/*.json
|
|
31
|
-
│ ├──
|
|
31
|
+
│ ├── main.css # Main stylesheet (imports tokens + compositions)
|
|
32
32
|
│ └── swatchkit-ui.css # UI styles for the documentation sidebar
|
|
33
33
|
├── swatchkit/
|
|
34
34
|
│ ├── _layout.html # Layout template (you own this)
|
|
@@ -158,7 +158,7 @@ You can mix modular scales with manual overrides.
|
|
|
158
158
|
|
|
159
159
|
### 5. CSS Workflow
|
|
160
160
|
|
|
161
|
-
SwatchKit generates `css/tokens.css` with your design tokens.
|
|
161
|
+
SwatchKit generates `css/tokens.css` with your design tokens. Your `css/main.css` imports this file along with layout primitives:
|
|
162
162
|
|
|
163
163
|
```css
|
|
164
164
|
@import 'tokens.css';
|
|
@@ -170,7 +170,7 @@ body {
|
|
|
170
170
|
}
|
|
171
171
|
```
|
|
172
172
|
|
|
173
|
-
The pattern library uses **your stylesheet** (`
|
|
173
|
+
The pattern library uses **your stylesheet** (`main.css`), so components render exactly as they will in your app.
|
|
174
174
|
|
|
175
175
|
**Documentation Styling:**
|
|
176
176
|
The sidebar and documentation layout are styled by `css/swatchkit-ui.css`. This file is separate from your app styles so you can customize the docs UI without affecting your production CSS.
|
package/build.js
CHANGED
|
@@ -116,7 +116,7 @@ function resolveSettings(cliOptions, fileConfig) {
|
|
|
116
116
|
? path.resolve(cwd, fileConfig.outDir)
|
|
117
117
|
: path.join(cwd, "public/swatchkit");
|
|
118
118
|
|
|
119
|
-
// CSS directory - where tokens.css and user's
|
|
119
|
+
// CSS directory - where tokens.css and user's main.css live
|
|
120
120
|
// Default: css/ at project root
|
|
121
121
|
const cssDir = fileConfig.cssDir
|
|
122
122
|
? path.resolve(cwd, fileConfig.cssDir)
|
|
@@ -153,7 +153,7 @@ function resolveSettings(cliOptions, fileConfig) {
|
|
|
153
153
|
outputFile: path.join(outDir, "index.html"),
|
|
154
154
|
outputJsFile: path.join(outDir, "js/swatches.js"),
|
|
155
155
|
tokensCssFile: path.join(cssDir, "tokens.css"),
|
|
156
|
-
|
|
156
|
+
mainCssFile: path.join(cssDir, "main.css"),
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
|
|
@@ -234,12 +234,12 @@ function runInit(settings, options) {
|
|
|
234
234
|
console.log(`Created tokens script at ${tokensScriptFile}`);
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
// Create
|
|
238
|
-
if (!fs.existsSync(settings.
|
|
239
|
-
const srcPath = path.join(__dirname, "src/blueprints/
|
|
237
|
+
// Create main.css entry point
|
|
238
|
+
if (!fs.existsSync(settings.mainCssFile)) {
|
|
239
|
+
const srcPath = path.join(__dirname, "src/blueprints/main.css");
|
|
240
240
|
const content = fs.readFileSync(srcPath, "utf-8");
|
|
241
|
-
fs.writeFileSync(settings.
|
|
242
|
-
console.log(`Created
|
|
241
|
+
fs.writeFileSync(settings.mainCssFile, content);
|
|
242
|
+
console.log(`Created main stylesheet at ${settings.mainCssFile}`);
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
// Copy CSS Reset
|
|
@@ -637,7 +637,7 @@ function watch(settings) {
|
|
|
637
637
|
settings.swatchkitDir,
|
|
638
638
|
settings.tokensDir,
|
|
639
639
|
settings.projectLayout,
|
|
640
|
-
settings.
|
|
640
|
+
settings.mainCssFile,
|
|
641
641
|
].filter((p) => fs.existsSync(p)); // Only watch files that exist
|
|
642
642
|
|
|
643
643
|
console.log("[SwatchKit] Watch mode enabled.");
|
package/package.json
CHANGED
package/src/layout.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>SwatchKit</title>
|
|
7
|
-
<link rel="stylesheet" href="css/
|
|
7
|
+
<link rel="stylesheet" href="css/main.css" />
|
|
8
8
|
<link rel="stylesheet" href="css/swatchkit-ui.css" />
|
|
9
9
|
<!-- HEAD_EXTRAS -->
|
|
10
10
|
</head>
|