File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -120,24 +120,25 @@ import {
120120 stringifyStyleRule ,
121121} from " react-style-stringify" ;
122122
123- type MyStyle = {
124- padding: number ;
123+ type MyStyles = {
124+ padding: string | number ;
125125 fontSize: number ;
126+ " --my-custom-prop" : string ;
126127};
127128
128- stringifyStyleDeclaration <MyStyle >({
129- padding: 10 ,
130- fontSize: 16 ,
129+ stringifyStyleDeclaration <Partial < MyStyles > >({
130+ padding: 20 ,
131+ " --my-custom-prop " : " brown " ,
131132})
132- // Output: "padding:10px;font-size:16px ;"
133+ // Output: "padding:20px;--my-custom-prop:brown ;"
133134
134- stringifyStyleRule <MyStyle >({
135+ stringifyStyleRule <Partial < MyStyles > >({
135136 " .container" : {
136- padding: 10 ,
137- fontSize: 16 ,
137+ padding: 20 ,
138+ " --my-custom-prop " : " brown " ,
138139 },
139- });
140- // Output: ".container{" padding:10px;font-size:16px;" }"
140+ })
141+ // Output: ".container{padding:20px;--my-custom-prop:brown; }"
141142```
142143
143144> [ !NOTE]
You can’t perform that action at this time.
0 commit comments