UNPKG

1.55 kBMarkdownView Raw
1# declaration-property-unit-allowed-list
2
3Specify a list of allowed property and unit pairs within declarations.
4
5<!-- prettier-ignore -->
6```css
7a { width: 100px; }
8/** ↑ ↑
9 * These properties and these units */
10```
11
12## Options
13
14`object`: `{ "unprefixed-property-name": ["array", "of", "units"] }`
15
16If a property name is surrounded with `"/"` (e.g. `"/^animation/"`), it is interpreted as a regular expression. This allows, for example, easy targeting of shorthands: `/^animation/` will match `animation`, `animation-duration`, `animation-timing-function`, etc.
17
18Given:
19
20```
21{
22 "font-size": ["em", "px"],
23 "/^animation/": ["s"],
24 "line-height": []
25}
26```
27
28The following patterns are considered violations:
29
30<!-- prettier-ignore -->
31```css
32a { font-size: 1.2rem; }
33```
34
35<!-- prettier-ignore -->
36```css
37a { animation: animation-name 500ms ease; }
38```
39
40<!-- prettier-ignore -->
41```css
42a { -webkit-animation: animation-name 500ms ease; }
43```
44
45<!-- prettier-ignore -->
46```css
47a { animation-duration: 500ms; }
48```
49
50<!-- prettier-ignore -->
51```css
52a { line-height: 13px; }
53```
54
55The following patterns are _not_ considered violations:
56
57<!-- prettier-ignore -->
58```css
59a { font-size: 1em; }
60```
61
62<!-- prettier-ignore -->
63```css
64a { height: 100px; }
65```
66
67<!-- prettier-ignore -->
68```css
69a { animation: animation-name 5s ease; }
70```
71
72<!-- prettier-ignore -->
73```css
74a { -webkit-animation: animation-name 5s ease; }
75```
76
77<!-- prettier-ignore -->
78```css
79a { animation-duration: 5s; }
80```
81
82<!-- prettier-ignore -->
83```css
84a { line-height: 1; }
85```