|
7 | 7 | [](https://conventionalcommits.org)
|
8 | 8 | [](https://github.com/semantic-release/semantic-release)
|
9 | 9 |
|
10 |
| -A [stylelint](https://github.com/stylelint/stylelint) plugin that enforces either variables (`$sass`, `namespace.$sass`, `@less`, `var(--cssnext)`), functions or custom CSS values, like keywords (`inherit`, `none`, `currentColor` etc.), colors (`#fff`, `red`, etc.) or numbers incl. units (`0`, `1px`, `100%`, etc.) for CSS longhand and shorthand properties. |
| 10 | +A [stylelint](https://github.com/stylelint/stylelint) plugin that enforces either variables (`$sass`, `namespace.$sass`, `@less`, `var(--cssnext)`, `css-loader @value`), functions or custom CSS values, like keywords (`inherit`, `none`, `currentColor` etc.), colors (`#fff`, `red`, etc.) or numbers incl. units (`0`, `1px`, `100%`, etc.) for CSS longhand and shorthand properties. |
11 | 11 |
|
12 | 12 | <!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
13 | 13 | <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
@@ -106,6 +106,14 @@ a { color: -$color-white; }
|
106 | 106 | a { color: darken(#fff, 10%); }
|
107 | 107 | ```
|
108 | 108 |
|
| 109 | +```css |
| 110 | +@value v-color-white: #fff; |
| 111 | + |
| 112 | +a { color: v-color-white; } |
| 113 | + |
| 114 | +a { color: -v-color-white; } |
| 115 | +``` |
| 116 | + |
109 | 117 | ### Scheme
|
110 | 118 |
|
111 | 119 | The config scheme looks as follows:
|
|
214 | 222 | }
|
215 | 223 | ```
|
216 | 224 |
|
| 225 | +```css |
| 226 | +@value v-color-white: #fff; |
| 227 | +@value v-z-index: 123; |
| 228 | +@value v-font-size: 2em; |
| 229 | + |
| 230 | +a { |
| 231 | + color: v-color-white; |
| 232 | + z-index: v-z-index; |
| 233 | + font-size: v-font-size; |
| 234 | +} |
| 235 | +``` |
| 236 | + |
217 | 237 | **Note:** Multiple Properties require you to use nested arrays `[[]]` in your configuration.
|
218 | 238 |
|
219 | 239 | #### Regex support
|
|
279 | 299 | }
|
280 | 300 | ```
|
281 | 301 |
|
| 302 | +```css |
| 303 | +@value v-color-white: #fff; |
| 304 | + |
| 305 | +a { |
| 306 | + color: v-color-white; |
| 307 | + background-color: v-color-white; |
| 308 | + border-color: v-color-white; |
| 309 | +} |
| 310 | +``` |
| 311 | + |
282 | 312 | ### Secondary Options
|
283 | 313 |
|
284 | 314 | Additionally you can pass an optional second options hash to enable/disable variables, functions and custom keywords.
|
@@ -325,6 +355,12 @@ a { color: $color-white; }
|
325 | 355 | a { color: namespace.$color-white; }
|
326 | 356 | ```
|
327 | 357 |
|
| 358 | +```css |
| 359 | +@value v-color-white: #fff; |
| 360 | + |
| 361 | +a { color: v-color-white; } |
| 362 | +``` |
| 363 | + |
328 | 364 | The following patterns are **not** considered **warnings:**
|
329 | 365 |
|
330 | 366 | ```css
|
|
0 commit comments