5.1 “Jianyuan”
Autoprefixer 5.1 has support for many new properties and at-rules and remove prefixes in values with higher accuracy.
New At-Rules
Now Autoprefixer adds prefixes for @viewport
and min-resolution
/max-resolution
query in CSS Media Queries:
@viewport {
width: device-width;
}
@media (min-resolution: 192dpi), (min-resolution: 2dppx) {
background: url(image@2x.jpg);
}
↓
@-ms-viewport {
width: device-width;
}
@-o-viewport {
width: device-width;
}
@viewport {
width: device-width;
}
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi), (min-resolution: 2dppx) {
background: url(image@2x.jpg);
}
Also new Autoprefixer doesn’t remove your code style while adding prefixes to @keyframes
and @viewport
.
New Properties
@yisibl find many new properties for Autoprefixer and helped to implement them:
a {
text-emphasis: dot;
image-rendering: crisp-edges;
text-align-last: justify;
text-overflow: ellipsis;
margin-block-start: 10px;
padding-inline-end: 10px;
}
↓
a {
-webkit-text-emphasis: dot;
text-emphasis: dot;
image-rendering: -webkit-optimize-contrast;
image-rendering: -moz-crisp-edges;
image-rendering: -o-crisp-edges;
image-rendering: crisp-edges;
-moz-text-align-last: justify;
text-align-last: justify;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
-webkit-margin-before: 10px;
margin-block-start: 10px;
-webkit-padding-end: 10px;
-moz-padding-end: 10px;
padding-inline-end: 10px;
}
Vendor Hacks in Values
Autoprefixer removes outdated prefixes. But it is smart and understand, when you use old prefix for vendor-specific hack like -webkit-transform: translateZ(0)
.
Unfortunately, previous Autoprefixer detected vendor hacks only in properties, but removed all old prefixes in values. Autoprefixer 5.1 became more attentive and doesn’t remove prefix if there is not unprefixed version around.
Browserslist 0.2
Autoprefixer 5.1 uses Browserslist 0.2. Can I Use joins some versions like ios_saf 7.0-7.1
and in Browserslist you can select this joinded versions only by latest version iOS 7.1
.
@iamvdo found this lost versions and fix it. Now you can select ios_saf 7.0-7.1
by iOS 7.0
or even iOS 7
.
Other Changes
- Return
autoprefixer.defaults
as alias to currentbrowserslist.defaults
. - Fix
-webkit-filter
intransition
. - Fix compatibility with
postcss-import
(by @jasonkuhrt). - Fix Flexbox prefixes for BlackBerry and UC Browser.
- Fix gradient prefixes for old Chrome.
- Add
--no-remove
option to CLI.