.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / rules / length-zero-no-unit / README.md
1 # length-zero-no-unit
2
3 Disallow units for zero lengths.
4
5 ```css
6 a { top: 0px; }
7 /**      ↑↑
8  * This zero and this type of length unit */
9 ```
10
11 *Lengths* refer to distance measurements. A length is a *dimension*, which is a *number* immediately followed by a *unit identifier*. However, for zero lengths the unit identifier is optional. The length units are: `em`, `ex`, `ch`, `vw`, `vh`, `cm`, `mm`, `in`, `pt`, `pc`, `px`, `rem`, `vmin`, and `vmax`.
12
13 The `--fix` option on the [command line](../../../docs/user-guide/cli.md#autofixing-errors) can automatically fix all of the problems reported by this rule.
14
15 ## Options
16
17 ### `true`
18
19 The following patterns are considered violations:
20
21 ```css
22 a { top: 0px }
23 ```
24
25 ```css
26 a { top: 0.000em }
27 ```
28
29 The following patterns are *not* considered violations:
30
31 ```css
32 a { top: 0 } /* no unit */
33 ```
34
35 ```css
36 a { transition-delay: 0s; } /* dimension */
37 ```
38
39 ```css
40 a { top: 2in; }
41 ```
42
43 ```css
44 a { top: 1.001vh }
45 ```
46
47 ## Optional secondary options
48
49 ### `ignore: ["custom-properties"]`
50
51 #### `"custom-properties"`
52
53 Ignore units for zero length in custom properties.
54
55 The following pattern is *not* considered a violation:
56
57 ```css
58 a { --x: 0px; }
59 ```