0

Possibly the dumbest question I've asked but I'm finding the documentation and the limited examples quite hazy.

I'd like to support as many browsers as possible, including IE7+ e.g.

.pipe(autoprefixer({
    browsers: ['last 5 versions', 'ie >= 7']
})

Logically, I assume the 'browsers' option above exists to define exactly which browsers, or range of browsers, should be supported. In other words, the above may translate as:

"Support the last 5 versions of every browser AND ensure that all versions of IE (from 7 upwards) are supported."

Another way of saying it:

"Don't remove any styles that are required by these browsers"

Have I understood the browsers option correctly please?

I am me
  • 131
  • 2
  • 12
  • By the way, Autoprefixer team recommends few changes: 1. Use `browserslist` config file or `browserslist` option in `package.json`. In this case many other tool will use this browsers. 2. `gulp-autoprefixer` is not official way. Official way is `gulp-postcss` with `autoprefixer`, because you will receive updates faster. – Andrey Sitnik Dec 25 '16 at 04:49
  • Ah, so with regard to postCSS, something like this?: `.pipe(postcss([ autoprefixer({ remove: false, browsers: ['last 5 versions', 'ie >= 7'] }) ]))` – I am me Dec 25 '16 at 04:53
  • 1
    The best way: `.pipe(postcss([ autoprefixer({ remove: false }) ]))` in `gulpfile.js` and `"browserslist": ["last 5 versions", "ie >= 7"]` in `package.json`. – Andrey Sitnik Dec 26 '16 at 05:59

1 Answers1

1

Yeap, you understand browsers correctly. ['last 5 versions', 'ie >= 7'] means “Support the last 5 versions of every browser and ensure that all versions of IE (from 7 upwards) are supported”.

Andrey Sitnik
  • 971
  • 6
  • 9