postcss/autoprefixer (autoprefixer)
### [`v9.6.0`](https://togithub.com/postcss/autoprefixer/releases/tag/9.6.0): 9.6 “Nunc id vides, nunc ne vides”
[Compare Source](https://togithub.com/postcss/autoprefixer/compare/9.5.1...9.6.0)
Autoprefixer 9.6 marked `browsers` option as deprecated and added `text-orientation` and `@media (min-resolution: 2x)` support.
We added the “Sponsor” button to your repository. You can support Autoprefixer and other open source projects important for your business by [Tidelift](https://tidelift.com/subscription/pkg/npm-autoprefixer).
#### Browsers
Autoprefixer adds prefixes only for target browsers, browsers which is support on your project.
Initially, Autoprefixer had the `browsers` option to set target browsers. But we found that many tools need target browsers too. [`postcss-preset-env`](https://preset-env.cssdb.org/) and `babel-preset-env` use them to add only actual polyfills, [postcss-normalize](https://togithub.com/csstools/postcss-normalize) uses them to add only necessary CSS reset rules, plugins for ESLint and Stylelint will warn you if some of the target browsers doesn’t support your code.
This is why we created [Browserslist](https://togithub.com/browserslist/browserslist) config file. It is a single config for all tools.
A lot of users still uses the `browsers` option. We understand them; it is hard to change old practice. Unfortunately, using the `browsers` option creates many problems. For instance, you can miss that your build tool has own Autoprefixer inside. It will cut your prefixes because it will not know about your target browsers.
This is why, in 9.6, we decided to deprecate the `browsers` option. Autoprefixer will show a warning on this option. In the next 10.0 release, we will drop this option. This is how you can migrate:
1. Create `browserslist` key with an array in `package.json`.
2. Copy queries from the `browsers` option. If you have `browsers: [“last 1 version”, “not dead”]`, then you need:
```js
"browserslist": [
"last 1 version",
"not dead"
]
```
#### HiDPI Media Query
We all need to support HiDPI/retina screen now. Autoprefixer supports specific media query for HiDPI screens:
```css
.image {
background-image: url(image@1x.png);
}
@media (min-resolution: 2dppx) {
.image {
background-image: url(image@2x.png);
}
}
```
```css
.image {
background-image: url(image@1x.png);
}
@media (-webkit-min-device-pixel-ratio: 2),
(-o-min-device-pixel-ratio: 2/1),
(min-resolution: 2dppx) {
.image {
background-image: url(image@2x.png);
}
}
```
Bug we found that [CSS Values 4 spec](https://www.w3.org/TR/css-values-4/#resolution) added `x` alias for `dppx`.
Autoprefixer 9.6 supports `@media (min-resolution: 2x)` shortcut. Note, that Autoprefixer will not convert it to `2dppx`. Autoprefixer adds only prefixes. Use [`postcss-preset-env`](https://preset-env.cssdb.org/) to add polyfills.
#### Other
- [`text-orientation`](https://tympanus.net/codrops/css_reference/text-orientation/) property support was added.
- [@jmmarco](https://togithub.com/jmmarco) added `CONTRIBUTING.md`
[ ] If you want to rebase/retry this PR, check this box
This PR contains the following updates:
9.5.1
->9.6.0
By merging this PR, the below issues will be automatically resolved and closed:
By merging this PR, the below issues will be automatically resolved and closed:
Release Notes
postcss/autoprefixer (autoprefixer)
### [`v9.6.0`](https://togithub.com/postcss/autoprefixer/releases/tag/9.6.0): 9.6 “Nunc id vides, nunc ne vides” [Compare Source](https://togithub.com/postcss/autoprefixer/compare/9.5.1...9.6.0) Autoprefixer 9.6 marked `browsers` option as deprecated and added `text-orientation` and `@media (min-resolution: 2x)` support. We added the “Sponsor” button to your repository. You can support Autoprefixer and other open source projects important for your business by [Tidelift](https://tidelift.com/subscription/pkg/npm-autoprefixer). #### Browsers Autoprefixer adds prefixes only for target browsers, browsers which is support on your project. Initially, Autoprefixer had the `browsers` option to set target browsers. But we found that many tools need target browsers too. [`postcss-preset-env`](https://preset-env.cssdb.org/) and `babel-preset-env` use them to add only actual polyfills, [postcss-normalize](https://togithub.com/csstools/postcss-normalize) uses them to add only necessary CSS reset rules, plugins for ESLint and Stylelint will warn you if some of the target browsers doesn’t support your code. This is why we created [Browserslist](https://togithub.com/browserslist/browserslist) config file. It is a single config for all tools. A lot of users still uses the `browsers` option. We understand them; it is hard to change old practice. Unfortunately, using the `browsers` option creates many problems. For instance, you can miss that your build tool has own Autoprefixer inside. It will cut your prefixes because it will not know about your target browsers. This is why, in 9.6, we decided to deprecate the `browsers` option. Autoprefixer will show a warning on this option. In the next 10.0 release, we will drop this option. This is how you can migrate: 1. Create `browserslist` key with an array in `package.json`. 2. Copy queries from the `browsers` option. If you have `browsers: [“last 1 version”, “not dead”]`, then you need: ```js "browserslist": [ "last 1 version", "not dead" ] ``` #### HiDPI Media Query We all need to support HiDPI/retina screen now. Autoprefixer supports specific media query for HiDPI screens: ```css .image { background-image: url(image@1x.png); } @media (min-resolution: 2dppx) { .image { background-image: url(image@2x.png); } } ``` ```css .image { background-image: url(image@1x.png); } @media (-webkit-min-device-pixel-ratio: 2), (-o-min-device-pixel-ratio: 2/1), (min-resolution: 2dppx) { .image { background-image: url(image@2x.png); } } ``` Bug we found that [CSS Values 4 spec](https://www.w3.org/TR/css-values-4/#resolution) added `x` alias for `dppx`. Autoprefixer 9.6 supports `@media (min-resolution: 2x)` shortcut. Note, that Autoprefixer will not convert it to `2dppx`. Autoprefixer adds only prefixes. Use [`postcss-preset-env`](https://preset-env.cssdb.org/) to add polyfills. #### Other - [`text-orientation`](https://tympanus.net/codrops/css_reference/text-orientation/) property support was added. - [@jmmarco](https://togithub.com/jmmarco) added `CONTRIBUTING.md`