.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / rules / declaration-property-unit-whitelist / README.md
1 # declaration-property-unit-whitelist
2
3 Specify a whitelist of allowed property and unit pairs within declarations.
4
5 ```css
6 a { width: 100px; }
7 /** ↑         ↑
8  * These properties and these units */
9 ```
10
11 ## Options
12
13 `object`: `{
14   "unprefixed-property-name": ["array", "of", "units"]
15 }`
16
17 If a property name is surrounded with `"/"` (e.g. `"/^animation/"`), it is interpreted as a regular expression. This allows, for example, easy targeting of shorthands: `/^animation/` will match `animation`, `animation-duration`, `animation-timing-function`, etc.
18
19 Given:
20
21 ```js
22 {
23   "font-size": ["em", "px"],
24   "/^animation/": ["s"],
25   "line-height": []
26 }
27 ```
28
29 The following patterns are considered violations:
30
31 ```css
32 a { font-size: 1.2rem; }
33 ```
34
35 ```css
36 a { animation: animation-name 500ms ease; }
37 ```
38
39 ```css
40 a { -webkit-animation: animation-name 500ms ease; }
41 ```
42
43 ```css
44 a { animation-duration: 500ms; }
45 ```
46
47 ```css
48 a { line-height: 13px; }
49 ```
50
51 The following patterns are *not* considered violations:
52
53 ```css
54 a { font-size: 1em; }
55 ```
56
57 ```css
58 a { height: 100px; }
59 ```
60
61 ```css
62 a { animation: animation-name 5s ease; }
63 ```
64
65 ```css
66 a { -webkit-animation: animation-name 5s ease; }
67 ```
68
69 ```css
70 a { animation-duration: 5s; }
71 ```
72
73 ```css
74 a { line-height: 1; }
75 ```