UNPKG

1.47 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
14## Options
15
16### `true`
17
18The following patterns are considered violations:
19
20<!-- prettier-ignore -->
21```css
22input::-moz-placeholder {}
23```
24
25<!-- prettier-ignore -->
26```css
27:-webkit-full-screen a {}
28```
29
30The following patterns are _not_ considered violations:
31
32<!-- prettier-ignore -->
33```css
34input::placeholder {}
35```
36
37<!-- prettier-ignore -->
38```css
39:full-screen a {}
40```
41
42## Optional secondary options
43
44### `ignoreSelectors: ["/regex/", "non-regex"]`
45
46Ignore vendor prefixes for selectors.
47
48Given:
49
50```
51["::-webkit-input-placeholder", "/-moz-.*/"]
52```
53
54The following patterns are _not_ considered violations:
55
56<!-- prettier-ignore -->
57```css
58input::-webkit-input-placeholder {
59 color: pink;
60}
61
62input::-moz-placeholder {
63 color: pink;
64}
65```