1 | # hue-degree-notation
|
2 |
|
3 | Specify number or angle notation for degree hues.
|
4 |
|
5 |
|
6 | ```css
|
7 | a { color: hsl(198deg 28% 50%) }
|
8 | /** ↑
|
9 | * This notation */
|
10 | ```
|
11 |
|
12 | Because hues are so often given in degrees, a hue can also be given as a number, which is interpreted as a number of degrees.
|
13 |
|
14 | The [`fix` option](../../../docs/user-guide/usage/options.md#fix) can automatically fix all of the problems reported by this rule.
|
15 |
|
16 | ## Options
|
17 |
|
18 | `string`: `"angle"|"number"`
|
19 |
|
20 | ### `"angle"`
|
21 |
|
22 | Degree hues _must always_ use angle notation.
|
23 |
|
24 | The following patterns are considered violations:
|
25 |
|
26 |
|
27 | ```css
|
28 | a { color: hsl(198 28% 50%) }
|
29 | ```
|
30 |
|
31 |
|
32 | ```css
|
33 | a { color: lch(56.29% 19.86 10 / 15%) }
|
34 | ```
|
35 |
|
36 | The following patterns are _not_ considered violations:
|
37 |
|
38 |
|
39 | ```css
|
40 | a { color: hsl(198deg 28% 50%) }
|
41 | ```
|
42 |
|
43 |
|
44 | ```css
|
45 | a { color: lch(56.29% 19.86 10deg / 15%) }
|
46 | ```
|
47 |
|
48 | ### `"number"`
|
49 |
|
50 | Degree hues _must always_ use the number notation.
|
51 |
|
52 | The following patterns are considered violations:
|
53 |
|
54 |
|
55 | ```css
|
56 | a { color: hsl(198deg 28% 50%) }
|
57 | ```
|
58 |
|
59 |
|
60 | ```css
|
61 | a { color: lch(56.29% 19.86 10deg / 15%) }
|
62 | ```
|
63 |
|
64 | The following patterns are _not_ considered violations:
|
65 |
|
66 |
|
67 | ```css
|
68 | a { color: hsl(198 28% 50%) }
|
69 | ```
|
70 |
|
71 |
|
72 | ```css
|
73 | a { color: lch(56.29% 19.86 10 / 15%) }
|
74 | ```
|