.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / rules / declaration-property-value-blacklist / README.md
1 # declaration-property-value-blacklist
2
3 Specify a blacklist of disallowed property and value pairs within declarations.
4
5 ```css
6 a { text-transform: uppercase; }
7 /** ↑               ↑
8  * These properties and these values */
9 ```
10
11 ## Options
12
13 `object`: `{
14   "unprefixed-property-name": ["array", "of", "values"],
15   "unprefixed-property-name": ["/regex/", "non-regex"]
16 }`
17
18 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.
19
20 The same goes for values. Keep in mind that a regular expression value is matched against the entire value of the declaration, not specific parts of it. For example, a value like `"10px solid rgba( 255 , 0 , 0 , 0.5 )"` will *not* match `"/^solid/"` (notice beginning of the line boundary) but *will* match `"/\\s+solid\\s+/"` or `"/\\bsolid\\b/"`.
21
22 Be careful with regex matching not to accidentally consider quoted string values and `url()` arguments. For example, `"/red/"` will match value such as `"1px dotted red"` as well as `"\"foo\""` and `"white url(/mysite.com/red.png)"`.
23
24 Given:
25
26 ```js
27 {
28   "transform": ["/scale3d/", "/rotate3d/", "/translate3d/"],
29   "position": ["fixed"],
30   "color": ["/^green/"],
31   "/^animation/": ["/ease/"]
32 }
33 ```
34
35 The following patterns are considered violations:
36
37 ```css
38 a { position: fixed; }
39 ```
40
41 ```css
42 a { transform: scale3d(1, 2, 3); }
43 ```
44
45 ```css
46 a { -webkit-transform: scale3d(1, 2, 3); }
47 ```
48
49 ```css
50 a { color: green; }
51 ```
52
53 ```css
54 a { animation: foo 2s ease-in-out; }
55 ```
56
57 ```css
58 a { animation-timing-function: ease-in-out; }
59 ```
60
61 ```css
62 a { -webkit-animation-timing-function: ease-in-out; }
63 ```
64
65 The following patterns are *not* considered violations:
66
67 ```css
68 a { position: relative; }
69 ```
70
71 ```css
72 a { transform: scale(2); }
73 ```
74
75 ```css
76 a { -webkit-transform: scale(2); }
77 ```
78
79 ```css
80 a { color: lightgreen; }
81 ```
82
83 ```css
84 a { animation: foo 2s linear; }
85 ```
86
87 ```css
88 a { animation-timing-function: linear; }
89 ```
90
91 ```css
92 a { -webkit-animation-timing-function: linear; }
93 ```