You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add support for scss files in cli
* Updated readme for SCSS files
* Fix format for readme
---------
Co-authored-by: John Richard Chipps-Harding <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+34-4Lines changed: 34 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -258,11 +258,12 @@ type PrimaryType = ButtonVariants["primary"];
258
258
259
259
## CLI Tool (Experimental)
260
260
261
-
We have included a CLI tool that allows you to generate components from CSS files which confirm to a specific naming convention. This is highly experimental and is subject to change.
261
+
We have included a CLI tool that allows you to generate components from CSS and SCSS files which confirm to a specific naming convention. This is highly experimental and is subject to change.
262
262
263
263
Consider this CSS file:
264
264
265
265
```css
266
+
/* styles.module.css */
266
267
nav.topBar {
267
268
background-color: #aaa;
268
269
padding: 32px;
@@ -276,13 +277,35 @@ nav.topBar_fixed_true {
276
277
}
277
278
```
278
279
279
-
You can generate a component from this file with the following command:
280
+
Or using SCSS (Sassy CSS):
281
+
282
+
```scss
283
+
// styles.module.scss
284
+
nav.topBar {
285
+
background-color: #aaa;
286
+
padding: 32px;
287
+
288
+
&_fixed_true {
289
+
position: fixed;
290
+
bottom: 0;
291
+
left: 0;
292
+
right: 0;
293
+
}
294
+
}
295
+
```
296
+
297
+
You can generate a component from this files with the following command:
-`--css` The path to the CSS file you want to generate a component from. This can also be a recursive glob pattern allowing you to scan your entire components directory.
337
+
-`--css` The path to the CSS or SCSS file you want to generate a component from. This can also be a recursive glob pattern allowing you to scan your entire components directory.
315
338
-`--output` The filename for the output file. Defaults to `styles.ts` which will be saved in the same directory as the CSS file.
316
339
-`--overwrite` If the output file already exists, this will overwrite it. Defaults to `false`.
317
340
318
-
Example to generate components from all CSS files in the components directory:
341
+
Example to generate components from all CSS and SCSS files in the components directory:
0 commit comments