.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / rules / number-max-precision / README.md
1 # number-max-precision
2
3 Limit the number of decimal places allowed in numbers.
4
5 ```css
6 a { top: 3.245634px; }
7 /**           ↑
8  * These decimal places */
9 ```
10
11 ## Options
12
13 `int`: Maximum number of decimal places allowed.
14
15 For example, with `2`:
16
17 The following patterns are considered violations:
18
19 ```css
20 a { top: 3.245px; }
21 ```
22
23 ```css
24 a { top: 3.245634px; }
25 ```
26
27 ```css
28 @media (min-width: 3.234em) {}
29 ```
30
31 The following patterns are *not* considered violations:
32
33 ```css
34 a { top: 3.24px; }
35 ```
36
37 ```css
38 @media (min-width: 3.23em) {}
39 ```
40
41 ## Optional secondary options
42
43 ### `ignoreUnits: ["/regex/", "string"]`
44
45 Ignore the precision of numbers for values with the specified units.
46
47 For example, with `2`.
48
49 Given:
50
51 ```js
52 ["/^my-/", "%"]
53 ```
54
55 The following patterns are considered violations:
56
57 ```css
58 a { top: 3.245px; }
59 ```
60
61 ```css
62 a { top: 3.245634px; }
63 ```
64
65 ```css
66 @media (min-width: 3.234em) {}
67 ```
68
69 The following patterns are *not* considered violations:
70
71 ```css
72 a { top: 3.245%; }
73 ```
74
75 ```css
76 @media (min-width: 3.23em) {}
77 ```
78
79 ```css
80 a {
81   width: 10.5432%;
82 }
83 ```
84
85 ```css
86 a { top: 3.245my-unit; }
87 ```
88
89 ```css
90 a {
91   width: 10.989my-other-unit;
92 }
93 ```