UNPKG

1.09 kBMarkdownView Raw
1# number-leading-zero
2
3Require or disallow a leading zero for fractional numbers less than 1.
4
5```css
6a { line-height: 0.5; }
7/** ↑
8 * This leading zero */
9```
10
11This rule ignores mixin parameters in Less.
12
13The `--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`string`: `"always"|"never"`
18
19### `"always"`
20
21There *must always* be a leading zero.
22
23The following patterns are considered violations:
24
25```css
26a { line-height: .5; }
27```
28
29```css
30a { transform: translate(2px, .4px); }
31```
32
33The following patterns are *not* considered violations:
34
35```css
36a { line-height: 0.5; }
37```
38
39```css
40a { transform: translate(2px, 0.4px); }
41```
42
43### `"never"`
44
45There *must never* be a leading zero.
46
47The following patterns are considered violations:
48
49```css
50a { line-height: 0.5; }
51```
52
53```css
54a { transform: translate(2px, 0.4px); }
55```
56
57The following patterns are *not* considered violations:
58
59```css
60a { line-height: .5; }
61```
62
63```css
64a { transform: translate(2px, .4px); }
65```