i'm using "cssnano": "^3.4.0", with grunt.
here's my config
postcss: {
dev: {
options: {
map: true,
processors: [
require('autoprefixer')({
browsers: 'last 2 version, IE 9'
}),
]
},
src: '_dev/css/main.css'
},
build: {
options: {
map: false,
processors: [
require('cssnano')()
]
},
src: '_site/css/main.css'
}
}, //postcss
this
-webkit-transform: rotate(129deg);
-ms-transform: rotate(129deg);
transform: rotate(129deg);
becomes this after the cssnano treatment:
-webkit-transform: rotate(129deg);
transform: rotate(129deg)
I'm supposed to keep the -ms-, why is it removed?
You need to pass the browsers option with cssnano's autoprefixer.
postcss: {
dev: {
options: {
map: true,
processors: [
require('autoprefixer')({
browsers: 'last 2 version, IE 9'
}),
]
},
src: '_dev/css/main.css'
},
build: {
options: {
map: false,
processors: [
require('cssnano')({autoprefixer: {browsers: 'last 2 version, IE 9'}})
]
},
src: '_site/css/main.css'
}
}, //postcss
Most helpful comment
You need to pass the
browsersoption with cssnano's autoprefixer.