.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / rules / unit-whitelist / README.md
1 # unit-whitelist
2
3 Specify a whitelist of allowed units.
4
5 ```css
6 a { width: 100px; }
7 /**           ↑
8  *  These units */
9 ```
10
11 ## Options
12
13 `array|string`: `["array", "of", "units"]|"unit"`
14
15 Given:
16
17 ```js
18 ["px", "em", "deg"]
19 ```
20
21 The following patterns are considered violations:
22
23 ```css
24 a { width: 100%; }
25 ```
26
27 ```css
28 a { font-size: 10rem; }
29 ```
30
31 ```css
32 a { animation: animation-name 5s ease; }
33 ```
34
35 The following patterns are *not* considered violations:
36
37 ```css
38 a { font-size: 1.2em; }
39 ```
40
41 ```css
42 a { line-height: 1.2; }
43 ```
44
45 ```css
46 a { height: 100px; }
47 ```
48
49 ```css
50 a { height: 100PX; }
51 ```
52
53 ```css
54 a { transform: rotate(30deg); }
55 ```
56
57 ## Optional secondary options
58
59 ### `ignoreProperties: { unit: ["property", "/regex/"] }`
60
61 Ignore units in the values of declarations with the specified properties.
62
63 For example, with `["px", "em"]`.
64
65 Given:
66
67 ```js
68 {
69   "rem": [ "line-height", "/^border/" ],
70   "%": [ "width" ]  
71 }
72 ```
73
74 The following patterns are *not* considered violations:
75
76 ```css
77 a { line-height: 0.1rem; }
78 ```
79
80 ```css
81 a { border-bottom-width: 6rem; }
82 ```
83
84 ```css
85 a { width: 100%; }
86 ```
87
88 The following patterns are considered violations:
89
90 ```css
91 a { margin: 0 20rem; }
92 ```
93
94 ```css
95 a { -moz-border-radius-topright: 20rem; }
96 ```
97
98 ```css
99 a { height: 100%; }
100 ```