UNPKG

1.44 kBMarkdownView Raw
1# hue-degree-notation
2
3Specify number or angle notation for degree hues.
4
5<!-- prettier-ignore -->
6```css
7 a { color: hsl(198deg 28% 50%) }
8/** ↑
9 * This notation */
10```
11
12Because 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
14The [`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
22Degree hues _must always_ use angle notation.
23
24The following patterns are considered violations:
25
26<!-- prettier-ignore -->
27```css
28a { color: hsl(198 28% 50%) }
29```
30
31<!-- prettier-ignore -->
32```css
33a { color: lch(56.29% 19.86 10 / 15%) }
34```
35
36The following patterns are _not_ considered violations:
37
38<!-- prettier-ignore -->
39```css
40a { color: hsl(198deg 28% 50%) }
41```
42
43<!-- prettier-ignore -->
44```css
45a { color: lch(56.29% 19.86 10deg / 15%) }
46```
47
48### `"number"`
49
50Degree hues _must always_ use the number notation.
51
52The following patterns are considered violations:
53
54<!-- prettier-ignore -->
55```css
56a { color: hsl(198deg 28% 50%) }
57```
58
59<!-- prettier-ignore -->
60```css
61a { color: lch(56.29% 19.86 10deg / 15%) }
62```
63
64The following patterns are _not_ considered violations:
65
66<!-- prettier-ignore -->
67```css
68a { color: hsl(198 28% 50%) }
69```
70
71<!-- prettier-ignore -->
72```css
73a { color: lch(56.29% 19.86 10 / 15%) }
74```