Skip to content

Commit 828dc5d

Browse files
authored
Merge pull request #20 from JimGitFE/development
doc: Update & Fix
2 parents 841acdc + a484c40 commit 828dc5d

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,23 @@
55
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.
66

77
## Installation & Setup (Auto)
8-
First, run create-css-utilities auto executable, installing css-utilities-generator, dependencies and configuration files into your project:
8+
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:
99
```bash
1010
# Automatic installation executable:
11-
> npx create-css-utilities
11+
> npx css-utils init
1212
```
13+
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:
14+
```typescript
15+
import "@/styles/index.scss"
16+
```
17+
> app/layout.tsx
1318
14-
Run the following command to start generatic css utilities:
19+
Run the following command to start generating css utilities on save:
1520
```bash
1621
# Run the following command (generates css utilities on save):
1722
> npm run utils
1823
```
19-
Now import the generated css file to the project root file, start watching for changes in your root directory and automatically regenerate the CSS utilities.
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.
2025

2126
## Dictionary <small>[source](https://github.com/JimGitFE/css-utilities-generator/blob/main/src/dictionary.ts)</small>
2227
|| Property | Class | CSS Output || Property | Class | CSS Output |
@@ -38,10 +43,10 @@ Now import the generated css file to the project root file, start watching for c
3843
|| | .gtc-4 | { grid-template-columns: 4 } || | .gap-20vw | { gap: 20vw } |
3944
|| | .gtc-5 | { grid-template-columns: 5 } || | .gap-80 | { gap: 80px } |
4045
|| margin | .m | { margin: value } || padding | .p | { padding: value } |
41-
|| | .ml-40 | { margin-left: 40px } || padding-left | .pl-40 | { padding-left: 40px } |
42-
|| | .mr-20vw | { margin-right: 20vw } || padding-right | .pr-20vw | { padding-right: 20vw } |
43-
|| | .mt-80 | { margin-top: 80px } || padding-top | .pt-80 | { padding-top: 80px } |
44-
|| | .mb | { margin-bottom: value } || padding-bottom | .pb | { padding-bottom: value } |
46+
|| | .ml-40 | { margin-left: 40px } || | .pl-40 | { padding-left: 40px } |
47+
|| | .mr-20vw | { margin-right: 20vw } || | .pr-20vw | { padding-right: 20vw } |
48+
|| | .mt-80 | { margin-top: 80px } || | .pt-80 | { padding-top: 80px } |
49+
|| | .mb | { margin-bottom: value } || | .pb | { padding-bottom: value } |
4550
> [dictionary.ts](https://github.com/JimGitFE/css-utilities-generator/blob/main/src/dictionary.ts)
4651
## Example
4752
```html

0 commit comments

Comments
 (0)