UNPKG

1.6 kBMarkdownView Raw
1# selector-no-vendor-prefix
2
3Disallow vendor prefixes for selectors.
4
5<!-- prettier-ignore -->
6```css
7input::-moz-placeholder {}
8/** ↑
9 * This prefix */
10```
11
12This 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
14The [`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
20The following patterns are considered violations:
21
22<!-- prettier-ignore -->
23```css
24input::-moz-placeholder {}
25```
26
27<!-- prettier-ignore -->
28```css
29:-webkit-full-screen a {}
30```
31
32The following patterns are _not_ considered violations:
33
34<!-- prettier-ignore -->
35```css
36input::placeholder {}
37```
38
39<!-- prettier-ignore -->
40```css
41:full-screen a {}
42```
43
44## Optional secondary options
45
46### `ignoreSelectors: ["/regex/", "non-regex"]`
47
48Ignore vendor prefixes for selectors.
49
50Given:
51
52```
53["::-webkit-input-placeholder", "/-moz-.*/"]
54```
55
56The following patterns are _not_ considered violations:
57
58<!-- prettier-ignore -->
59```css
60input::-webkit-input-placeholder {
61 color: pink;
62}
63
64input::-moz-placeholder {
65 color: pink;
66}
67```