1 | # unit-case
|
2 |
|
3 | Specify lowercase or uppercase for units.
|
4 |
|
5 |
|
6 | ```css
|
7 | a { width: 10px; }
|
8 | /** ↑
|
9 | * These units */
|
10 | ```
|
11 |
|
12 | The [`fix` option](../../../docs/user-guide/usage/options.md#fix) can automatically fix most of the problems reported by this rule.
|
13 |
|
14 | ## Options
|
15 |
|
16 | `string`: `"lower"|"upper"`
|
17 |
|
18 | ### `"lower"`
|
19 |
|
20 | The following patterns are considered violations:
|
21 |
|
22 |
|
23 | ```css
|
24 | a {
|
25 | width: 10PX;
|
26 | }
|
27 | ```
|
28 |
|
29 |
|
30 | ```css
|
31 | a {
|
32 | width: 10Px;
|
33 | }
|
34 | ```
|
35 |
|
36 |
|
37 | ```css
|
38 | a {
|
39 | width: 10pX;
|
40 | }
|
41 | ```
|
42 |
|
43 |
|
44 | ```css
|
45 | a {
|
46 | width: 10PIXEL;
|
47 | }
|
48 | ```
|
49 |
|
50 |
|
51 | ```css
|
52 | a {
|
53 | width: calc(10PX * 2);
|
54 | }
|
55 | ```
|
56 |
|
57 | The following patterns are _not_ considered violations:
|
58 |
|
59 |
|
60 | ```css
|
61 | a {
|
62 | width: 10px;
|
63 | }
|
64 | ```
|
65 |
|
66 |
|
67 | ```css
|
68 | a {
|
69 | width: calc(10px * 2);
|
70 | }
|
71 | ```
|
72 |
|
73 | ### `"upper"`
|
74 |
|
75 | The following patterns are considered violations:
|
76 |
|
77 |
|
78 | ```css
|
79 | a {
|
80 | width: 10px;
|
81 | }
|
82 | ```
|
83 |
|
84 |
|
85 | ```css
|
86 | a {
|
87 | width: 10Px;
|
88 | }
|
89 | ```
|
90 |
|
91 |
|
92 | ```css
|
93 | a {
|
94 | width: 10pX;
|
95 | }
|
96 | ```
|
97 |
|
98 |
|
99 | ```css
|
100 | a {
|
101 | width: 10pixel;
|
102 | }
|
103 | ```
|
104 |
|
105 |
|
106 | ```css
|
107 | a {
|
108 | width: calc(10px * 2);
|
109 | }
|
110 | ```
|
111 |
|
112 | The following patterns are _not_ considered violations:
|
113 |
|
114 |
|
115 | ```css
|
116 | a {
|
117 | width: 10PX;
|
118 | }
|
119 | ```
|
120 |
|
121 |
|
122 | ```css
|
123 | a {
|
124 | width: calc(10PX * 2);
|
125 | }
|
126 | ```
|