Skip to content

Commit 5d5f6e7

Browse files
committed
docs: added css-loader @value
1 parent 610d193 commit 5d5f6e7

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

README.md

+37-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
88
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
99

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.
1111

1212
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
1313
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
@@ -106,6 +106,14 @@ a { color: -$color-white; }
106106
a { color: darken(#fff, 10%); }
107107
```
108108

109+
```css
110+
@value v-color-white: #fff;
111+
112+
a { color: v-color-white; }
113+
114+
a { color: -v-color-white; }
115+
```
116+
109117
### Scheme
110118

111119
The config scheme looks as follows:
@@ -214,6 +222,18 @@ a {
214222
}
215223
```
216224

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+
217237
**Note:** Multiple Properties require you to use nested arrays `[[]]` in your configuration.
218238

219239
#### Regex support
@@ -279,6 +299,16 @@ a {
279299
}
280300
```
281301

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+
282312
### Secondary Options
283313

284314
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; }
325355
a { color: namespace.$color-white; }
326356
```
327357

358+
```css
359+
@value v-color-white: #fff;
360+
361+
a { color: v-color-white; }
362+
```
363+
328364
The following patterns are **not** considered **warnings:**
329365

330366
```css

0 commit comments

Comments
 (0)