UNPKG

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