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
Copy file name to clipboardExpand all lines: README.md
+76-39Lines changed: 76 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,76 +5,109 @@
5
5
TypeScript utility package that generates a utilities.css file on demand with shorthand class names for common CSS properties. By using intuitive notations like d-f (display: flex) as values for className attributes inside your jsx, this package streamlines your styling process, making your main CSS structure cleaner, reusable and more maintainable while ensuring consistent, efficient application of styles across your project.
6
6
7
7
## Installation & Setup (Auto)
8
+
8
9
First, run css-utils init CLI command, Initializes a css-utilities-creator configuration at your project root ([cuconfig.json](#configuration-file-defaults)) with properties as `writeTo` (generated css directory/fileName) `readFrom` (useful to avoid watching changes on unnecessary directories) and utils excecutable script:
10
+
9
11
```bash
10
12
# Automatic installation executable:
11
13
> npx css-utils init
12
14
```
15
+
13
16
A css file with on demand generated class utilities from jsx/tsx className attributes, is generated at `writeTo` path, default: ./styles/utilities.css Imported properly at main root project file:
17
+
14
18
```typescript
15
-
import"@/styles/index.scss"
19
+
import"@/styles/index.scss";
16
20
```
21
+
17
22
> app/layout.tsx
18
23
19
24
Run the following command to start generating css utilities on save:
25
+
20
26
```bash
21
27
# Run the following command (generates css utilities on save):
22
28
> npm run utils
23
29
```
24
-
Now the generated css file is imported to the project root file, start watching for changes in your root directory and automatically regenerate the CSS utilities.
30
+
31
+
Now the generated css file is imported to the project root file, start watching for changes in your root directory and automatically regenerate the CSS utilities.
0 commit comments