File tree 4 files changed +80
-0
lines changed
postcss-conditional-values
4 files changed +80
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,25 @@ color: csstools-if(--a-condition yellow else red);
119
119
csstools-if(<custom-property-name> <declaration-value> else <declaration-value>);
120
120
```
121
121
122
+ #### [ Stylelint] ( https://stylelint.io/user-guide/rules/declaration-property-value-no-unknown/#propertiessyntax--property-syntax- )
123
+
124
+ Stylelint is able to check for unknown property values.
125
+ Setting the correct configuration for this rule makes it possible to check even non-standard syntax.
126
+
127
+ ``` js
128
+ // Disallow unknown values for properties within declarations.
129
+ ' declaration-property-value-no-unknown' : [
130
+ true ,
131
+ {
132
+ propertiesSyntax: {
133
+ color: ' | csstools-if( <custom-property-name> <\' color\' > else <\' color\' > )' ,
134
+ ' background-color' : ' | csstools-if( <custom-property-name> <\' background-color\' > else <\' background-color\' > )' ,
135
+ // ... more properties ...
136
+ },
137
+ },
138
+ ],
139
+ ```
140
+
122
141
### ` true ` and ` false ` keywords
123
142
124
143
The ` true ` and ` false ` keywords are syntactic sugar for ` initial ` and ` <space> ` .
Original file line number Diff line number Diff line change @@ -73,6 +73,25 @@ color: csstools-if(--a-condition yellow else red);
73
73
csstools-if(<custom-property-name> <declaration-value> else <declaration-value>);
74
74
```
75
75
76
+ #### [ Stylelint] ( https://stylelint.io/user-guide/rules/declaration-property-value-no-unknown/#propertiessyntax--property-syntax- )
77
+
78
+ Stylelint is able to check for unknown property values.
79
+ Setting the correct configuration for this rule makes it possible to check even non-standard syntax.
80
+
81
+ ``` js
82
+ // Disallow unknown values for properties within declarations.
83
+ ' declaration-property-value-no-unknown' : [
84
+ true ,
85
+ {
86
+ propertiesSyntax: {
87
+ color: ' | csstools-if( <custom-property-name> <\' color\' > else <\' color\' > )' ,
88
+ ' background-color' : ' | csstools-if( <custom-property-name> <\' background-color\' > else <\' background-color\' > )' ,
89
+ // ... more properties ...
90
+ },
91
+ },
92
+ ],
93
+ ```
94
+
76
95
### ` true ` and ` false ` keywords
77
96
78
97
The ` true ` and ` false ` keywords are syntactic sugar for ` initial ` and ` <space> ` .
Original file line number Diff line number Diff line change @@ -379,6 +379,27 @@ design-token() = design-token( <token-path> [ to <unit> ]? )
379
379
The plugin can convert `px` to `rem` and `rem` to `px` via the [`unitsandvalues`](#unitsandvalues ) plugin options.
380
380
When a design token is unit-less any `unit` can be assigned with `to`.
381
381
382
+ #### [Stylelint ](https://stylelint.io/user-guide /rules/declaration-property-value-no-unknown /#propertiessyntax--property-syntax- )
383
+
384
+ Stylelint is able to check for unknown property values.
385
+ Setting the correct configuration for this rule makes it possible to check even non-standard syntax.
386
+
387
+ ```js
388
+ // Disallow unknown values for properties within declarations.
389
+ 'declaration-property-value-no-unknown ': [
390
+ true,
391
+ {
392
+ propertiesSyntax: {
393
+ color: ' | <design-token()>' ,
394
+ // ... more properties ...
395
+ },
396
+ typesSyntax: {
397
+ ' <design-token()>' : ' design-token( <string> [ to <ident> ]? )' ,
398
+ },
399
+ },
400
+ ],
401
+ ```
402
+
382
403
## Further reading
383
404
384
405
- [Why we think PostCSS Design Tokens is needed ]
Original file line number Diff line number Diff line change @@ -248,6 +248,27 @@ design-token() = design-token( <token-path> [ to <unit> ]? )
248
248
The plugin can convert `px` to `rem` and `rem` to `px` via the [`unitsandvalues`](#unitsandvalues ) plugin options.
249
249
When a design token is unit-less any `unit` can be assigned with `to`.
250
250
251
+ #### [Stylelint ](https://stylelint.io/user-guide /rules/declaration-property-value-no-unknown /#propertiessyntax--property-syntax- )
252
+
253
+ Stylelint is able to check for unknown property values.
254
+ Setting the correct configuration for this rule makes it possible to check even non-standard syntax.
255
+
256
+ ```js
257
+ // Disallow unknown values for properties within declarations.
258
+ 'declaration-property-value-no-unknown ': [
259
+ true,
260
+ {
261
+ propertiesSyntax: {
262
+ color: ' | <design-token()>' ,
263
+ // ... more properties ...
264
+ },
265
+ typesSyntax: {
266
+ ' <design-token()>' : ' design-token( <string> [ to <ident> ]? )' ,
267
+ },
268
+ },
269
+ ],
270
+ ```
271
+
251
272
## Further reading
252
273
253
274
- [Why we think PostCSS Design Tokens is needed ]
You can’t perform that action at this time.
0 commit comments