1 | # color-hex-length
|
2 |
|
3 | Specify short or long notation for hex colors.
|
4 |
|
5 |
|
6 | ```css
|
7 | a { color: #fff }
|
8 | /** ↑
|
9 | * This hex color */
|
10 | ```
|
11 |
|
12 | The [`fix` option](../../../docs/user-guide/usage/options.md#fix) can automatically fix all of the problems reported by this rule.
|
13 |
|
14 | ## Options
|
15 |
|
16 | `string`: `"short"|"long"`
|
17 |
|
18 | ### `"short"`
|
19 |
|
20 | The following patterns are considered violations:
|
21 |
|
22 |
|
23 | ```css
|
24 | a { color: #ffffff; }
|
25 | ```
|
26 |
|
27 |
|
28 | ```css
|
29 | a { color: #ffffffaa; }
|
30 | ```
|
31 |
|
32 | The following patterns are _not_ considered violations:
|
33 |
|
34 |
|
35 | ```css
|
36 | a { color: #fff; }
|
37 | ```
|
38 |
|
39 |
|
40 | ```css
|
41 | a { color: #fffa; }
|
42 | ```
|
43 |
|
44 |
|
45 | ```css
|
46 | a { color: #a4a4a4; }
|
47 | ```
|
48 |
|
49 | ### `"long"`
|
50 |
|
51 | The following patterns are considered violations:
|
52 |
|
53 |
|
54 | ```css
|
55 | a { color: #fff; }
|
56 | ```
|
57 |
|
58 |
|
59 | ```css
|
60 | a { color: #fffa; }
|
61 | ```
|
62 |
|
63 | The following patterns are _not_ considered violations:
|
64 |
|
65 |
|
66 | ```css
|
67 | a { color: #ffffff; }
|
68 | ```
|
69 |
|
70 |
|
71 | ```css
|
72 | a { color: #ffffffaa; }
|
73 | ```
|