UNPKG

1.41 kBMarkdownView Raw
1# declaration-property-unit-blacklist
2
3Specify a blacklist of disallowed 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}
25```
26
27The following patterns are considered violations:
28
29<!-- prettier-ignore -->
30```css
31a { font-size: 1em; }
32```
33
34<!-- prettier-ignore -->
35```css
36a { animation: animation-name 5s ease; }
37```
38
39<!-- prettier-ignore -->
40```css
41a { -webkit-animation: animation-name 5s ease; }
42```
43
44<!-- prettier-ignore -->
45```css
46a { animation-duration: 5s; }
47```
48
49The following patterns are _not_ considered violations:
50
51<!-- prettier-ignore -->
52```css
53a { font-size: 1.2rem; }
54```
55
56<!-- prettier-ignore -->
57```css
58a { height: 100px; }
59```
60
61<!-- prettier-ignore -->
62```css
63a { animation: animation-name 500ms ease; }
64```
65
66<!-- prettier-ignore -->
67```css
68a { -webkit-animation: animation-name 500ms ease; }
69```
70
71<!-- prettier-ignore -->
72```css
73a { animation-duration: 500ms; }
74```