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 | The [`fix` option](../../../docs/user-guide/usage/options.md#fix) can automatically fix all of the problems reported by this rule.
|
15 |
|
16 | ## Options
|
17 |
|
18 | ### `true`
|
19 |
|
20 | The following patterns are considered violations:
|
21 |
|
22 |
|
23 | ```css
|
24 | input::-moz-placeholder {}
|
25 | ```
|
26 |
|
27 |
|
28 | ```css
|
29 | :-webkit-full-screen a {}
|
30 | ```
|
31 |
|
32 | The following patterns are _not_ considered violations:
|
33 |
|
34 |
|
35 | ```css
|
36 | input::placeholder {}
|
37 | ```
|
38 |
|
39 |
|
40 | ```css
|
41 | :full-screen a {}
|
42 | ```
|
43 |
|
44 | ## Optional secondary options
|
45 |
|
46 | ### `ignoreSelectors: ["/regex/", "non-regex"]`
|
47 |
|
48 | Ignore vendor prefixes for selectors.
|
49 |
|
50 | Given:
|
51 |
|
52 | ```
|
53 | ["::-webkit-input-placeholder", "/-moz-.*/"]
|
54 | ```
|
55 |
|
56 | The following patterns are _not_ considered violations:
|
57 |
|
58 |
|
59 | ```css
|
60 | input::-webkit-input-placeholder {
|
61 | color: pink;
|
62 | }
|
63 |
|
64 | input::-moz-placeholder {
|
65 | color: pink;
|
66 | }
|
67 | ```
|