1 | # Autoprefixer [![Cult Of Martians][cult-img]][cult]
|
2 |
|
3 | <img align="right" width="94" height="71"
|
4 | src="http://postcss.github.io/autoprefixer/logo.svg"
|
5 | title="Autoprefixer logo by Anton Lovchikov">
|
6 |
|
7 | [PostCSS] plugin to parse CSS and add vendor prefixes to CSS rules using values
|
8 | from [Can I Use]. It is recommended by Google and used in Twitter and Alibaba.
|
9 |
|
10 | Write your CSS rules without vendor prefixes (in fact, forget about them
|
11 | entirely):
|
12 |
|
13 | ```css
|
14 | ::placeholder {
|
15 | color: gray;
|
16 | }
|
17 |
|
18 | .image {
|
19 | background-image: url(image@1x.png);
|
20 | }
|
21 | @media (min-resolution: 2dppx) {
|
22 | .image {
|
23 | background-image: url(image@2x.png);
|
24 | }
|
25 | }
|
26 | ```
|
27 |
|
28 | Autoprefixer will use the data based on current browser popularity and property
|
29 | support to apply prefixes for you. You can try the [interactive demo]
|
30 | of Autoprefixer.
|
31 |
|
32 | ```css
|
33 | ::-moz-placeholder {
|
34 | color: gray;
|
35 | }
|
36 | ::placeholder {
|
37 | color: gray;
|
38 | }
|
39 |
|
40 | .image {
|
41 | background-image: url(image@1x.png);
|
42 | }
|
43 | @media (-webkit-min-device-pixel-ratio: 2),
|
44 | (min-resolution: 2dppx) {
|
45 | .image {
|
46 | background-image: url(image@2x.png);
|
47 | }
|
48 | }
|
49 | ```
|
50 |
|
51 | Twitter account for news and releases: [@autoprefixer].
|
52 |
|
53 | <a href="https://evilmartians.com/?utm_source=autoprefixer">
|
54 | <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Sponsored by Evil Martians" width="236" height="54">
|
55 | </a>
|
56 |
|
57 | [interactive demo]: https://autoprefixer.github.io/
|
58 | [@autoprefixer]: https://twitter.com/autoprefixer
|
59 | [Can I Use]: https://caniuse.com/
|
60 | [cult-img]: http://cultofmartians.com/assets/badges/badge.svg
|
61 | [PostCSS]: https://github.com/postcss/postcss
|
62 | [cult]: http://cultofmartians.com/tasks/autoprefixer-grid.html
|
63 |
|
64 |
|
65 | ## Docs
|
66 | Read **[full docs](https://github.com/postcss/autoprefixer#readme)** on GitHub.
|