1 | # selector-pseudo-element-whitelist
|
2 |
|
3 | Specify a whitelist of allowed pseudo-element selectors.
|
4 |
|
5 |
|
6 | ```css
|
7 | a::before {}
|
8 | /** ↑
|
9 | * This pseudo-element selector */
|
10 | ```
|
11 |
|
12 | This rule ignores:
|
13 |
|
14 | - CSS2 pseudo-elements i.e. those prefixed with a single colon
|
15 | - selectors that use variable interpolation e.g. `::#{$variable} {}`
|
16 |
|
17 | ## Options
|
18 |
|
19 | `array|string|regex`: `["array", "of", "unprefixed", "pseudo-elements" or "regex"]|"pseudo-element"|/regex/`
|
20 |
|
21 | Given:
|
22 |
|
23 | ```
|
24 | ["before", "/^my-/i"]
|
25 | ```
|
26 |
|
27 | The following patterns are considered violations:
|
28 |
|
29 |
|
30 | ```css
|
31 | a::after {}
|
32 | ```
|
33 |
|
34 |
|
35 | ```css
|
36 | a::not-my-pseudo-element {}
|
37 | ```
|
38 |
|
39 | The following patterns are _not_ considered violations:
|
40 |
|
41 |
|
42 | ```css
|
43 | a::before {}
|
44 | ```
|
45 |
|
46 |
|
47 | ```css
|
48 | a::my-pseudo-element {}
|
49 | ```
|
50 |
|
51 |
|
52 | ```css
|
53 | a::MY-OTHER-pseudo-element {}
|
54 | ```
|