1 | # declaration-property-unit-blacklist
|
2 |
|
3 | Specify a blacklist of disallowed property and unit pairs within declarations.
|
4 |
|
5 |
|
6 | ```css
|
7 | a { width: 100px; }
|
8 | /** ↑ ↑
|
9 | * These properties and these units */
|
10 | ```
|
11 |
|
12 | ## Options
|
13 |
|
14 | `object`: `{ "unprefixed-property-name": ["array", "of", "units"] }`
|
15 |
|
16 | If 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 |
|
18 | Given:
|
19 |
|
20 | ```
|
21 | {
|
22 | "font-size": ["em", "px"],
|
23 | "/^animation/": ["s"]
|
24 | }
|
25 | ```
|
26 |
|
27 | The following patterns are considered violations:
|
28 |
|
29 |
|
30 | ```css
|
31 | a { font-size: 1em; }
|
32 | ```
|
33 |
|
34 |
|
35 | ```css
|
36 | a { animation: animation-name 5s ease; }
|
37 | ```
|
38 |
|
39 |
|
40 | ```css
|
41 | a { -webkit-animation: animation-name 5s ease; }
|
42 | ```
|
43 |
|
44 |
|
45 | ```css
|
46 | a { animation-duration: 5s; }
|
47 | ```
|
48 |
|
49 | The following patterns are _not_ considered violations:
|
50 |
|
51 |
|
52 | ```css
|
53 | a { font-size: 1.2rem; }
|
54 | ```
|
55 |
|
56 |
|
57 | ```css
|
58 | a { height: 100px; }
|
59 | ```
|
60 |
|
61 |
|
62 | ```css
|
63 | a { animation: animation-name 500ms ease; }
|
64 | ```
|
65 |
|
66 |
|
67 | ```css
|
68 | a { -webkit-animation: animation-name 500ms ease; }
|
69 | ```
|
70 |
|
71 |
|
72 | ```css
|
73 | a { animation-duration: 500ms; }
|
74 | ```
|