github postcss/autoprefixer 5.2.0
5.2 “Dont tread on me”

latest releases: 10.4.19, 10.4.18, 10.4.17...
8 years ago

Gadsden flag

Autoprefixer 5.2 is 30% faster, adds prefixes for appearance and uses warnings API from PostCSS 4.1.

Prefixes

  • Autoprefixer 5.2 will add -webkit- and -moz- prefixes for appearance: none, because it became part of W3C draft. Note, that only none value is supported.
  • In 5.1.6 release we made a mistake by adding ::placeholder pseudo-elements prefixes for :placeholder-shown pseudo-classes selector. This release fixes it.
  • There was confused situation with prefixes for image-rendering. Prefixed -moz-crisp-edges value works like W3C’s pixelated, not like crisp-edges. So Autoprefixer 5.2 will add prefixes only for pixelated value.
    Because there is no even plans for crisp-edges browsers support, Autoprefixer will warn you about crisp-edges value in your CSS. It will help you to update styles.
  • Also 5.2 release contains fix for text-decoration prefixes.

Warnings

PostCSS 4.1 brings new APIs for plugins. Most important new API for Autoprefixer is a warnings.

Outdated articles and copy-paste developing created many pain for us. There are many code examples with display: box value by 2009 spec, instead of display: flex in final spec. Or many legacy CSS and outdated examples uses old gradient direction syntax (bottom instead of final to top).

Autoprefixer 5.2 will print a warning, when it see outdated syntax in unprefixed properties:

autoprefixer: app.css:104:4: You should write display: flex by final spec instead of display: box

If you develop a builder plugin with Autoprefixer (like gulp-autoprefixer), please print warnings in most proper way for your builder API:

postcss([ autoprefixer ]).then(function (result) {
    result.warnings().forEach(function (warn) {
        console.warn(warn.toString());
    });
    callback(result.css);
});

API

Modular architecture shows great results in PostCSS. So @ben-eb decided to create a modular CSS minifier [cssnano](of course as PostCSS plugin). Autoprefixer 5.2 has special option for it: add: false will disable adding new prefixes, so Autoprefixer will only remove outdated prefixes.

PostCSS now has a great ecosystem. So maintaining Autoprefixer only solution takes too much time. Because Autoprefixer is just a PostCSS plugin, we can deprecate:

  • autoprefixer CLI tool. Use postcss-cli instead.
  • autoprefixer.process() shortcut. Use PostCSS API instead.

Don't miss a new autoprefixer release

NewReleases is sending notifications on new releases.