@@ -35,12 +35,14 @@ npm install --save-dev css-typed
35
35
Run ` css-typed ` and pass it a glob targeting your CSS files.
36
36
37
37
``` shell
38
- npx css-typed ' src/**/*.css'
38
+ npx css-typed " src/**/*.css"
39
39
```
40
40
41
41
This will generate ` .d.css.ts ` files next to the original source files.
42
42
43
- > ** Note**
43
+ See the [ run script recipe] ( #run-script ) for adding to your ` package.json ` .
44
+
45
+ > [ !NOTE]
44
46
>
45
47
> A CSS module file with the name ` foo.module.css ` will emit ` foo.module.d.css.ts ` .
46
48
@@ -114,7 +116,7 @@ For example, `my-class` becomes `myClass` and you cannot use `my-class` in JS/TS
114
116
Modern bundlers or build system such as Vite and Gatsby support this transformation.
115
117
The default matches CSS naming practices (` kebab-case ` ).
116
118
117
- > ** IMPORTANT**
119
+ > [ ! IMPORTANT]
118
120
>
119
121
> Note that ` camelCase ` and ` dashes ` MAY have TypeScript bugs.
120
122
> TypeScript 5.6 may help with the named exports for these.
@@ -127,18 +129,23 @@ The default matches CSS naming practices (`kebab-case`).
127
129
128
130
### Run script
129
131
130
- To run it as part of your build, you will likely include it as a run script, maybe as ` codegen ` or ` pretsc ` .
132
+ To run it as part of your build, you will likely include it as a run script, maybe as ` codegen ` , ` css-typed ` , or ` pretsc ` .
131
133
132
134
``` json
133
135
{
134
136
"scripts" : {
135
137
"codegen" : " css-typed \" src/**/*.css\" " ,
138
+ "css-typed" : " css-typed \" src/**/*.css\" " ,
136
139
"pretsc" : " css-typed \" src/**/*.css\" " ,
137
140
"tsc" : " tsc"
138
141
}
139
142
}
140
143
```
141
144
145
+ > [ !NOTE]
146
+ >
147
+ > Use ` \" ` in your run scripts for Windows OS compatibility.
148
+
142
149
### Watch
143
150
144
151
The CLI does not have built-in watch support.
0 commit comments