1 | # selector-no-vendor-prefix
|
2 |
|
3 | Disallow vendor prefixes for selectors.
|
4 |
|
5 |
|
6 | ```css
|
7 | input::-moz-placeholder {}
|
8 | /** ↑
|
9 | * This prefix */
|
10 | ```
|
11 |
|
12 | This rule does not blanketly condemn vendor prefixes. Instead, it uses [Autoprefixer's](https://github.com/postcss/autoprefixer) up-to-date data (from [caniuse.com](http://caniuse.com/)) to know whether a vendor prefix should cause a violation or not. _If you've included a vendor prefixed selector that has a standard alternative, one that Autoprefixer could take care of for you, this rule will complain about it_. If, however, you use a non-standard vendor-prefixed selector, one that Autoprefixer would ignore and could not provide, this rule will ignore it.
|
13 |
|
14 | ## Options
|
15 |
|
16 | ### `true`
|
17 |
|
18 | The following patterns are considered violations:
|
19 |
|
20 |
|
21 | ```css
|
22 | input::-moz-placeholder {}
|
23 | ```
|
24 |
|
25 |
|
26 | ```css
|
27 | :-webkit-full-screen a {}
|
28 | ```
|
29 |
|
30 | The following patterns are _not_ considered violations:
|
31 |
|
32 |
|
33 | ```css
|
34 | input::placeholder {}
|
35 | ```
|
36 |
|
37 |
|
38 | ```css
|
39 | :full-screen a {}
|
40 | ```
|
41 |
|
42 | ## Optional secondary options
|
43 |
|
44 | ### `ignoreSelectors: ["/regex/", "non-regex"]`
|
45 |
|
46 | Ignore vendor prefixes for selectors.
|
47 |
|
48 | Given:
|
49 |
|
50 | ```
|
51 | ["::-webkit-input-placeholder", "/-moz-.*/"]
|
52 | ```
|
53 |
|
54 | The following patterns are _not_ considered violations:
|
55 |
|
56 |
|
57 | ```css
|
58 | input::-webkit-input-placeholder {
|
59 | color: pink;
|
60 | }
|
61 |
|
62 | input::-moz-placeholder {
|
63 | color: pink;
|
64 | }
|
65 | ```
|