Skip to content
This repository was archived by the owner on Sep 15, 2020. It is now read-only.

Commit 117e384

Browse files
committed
Switch to grunt-postcss and add a few more processors.
Also, move autoprefixer's config to .browserlistrc.
1 parent 48fad02 commit 117e384

File tree

4 files changed

+177
-70
lines changed

4 files changed

+177
-70
lines changed

.browserslistrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# https://github.com/ai/browserslist#browserslist
2+
3+
last 2 versions
4+
> 1%
5+
Edge >= 12
6+
Explorer >= 9
7+
Firefox ESR
8+
Opera 12.1

Gruntfile.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,20 +93,17 @@ module.exports = function(grunt) {
9393
}
9494
},
9595

96-
autoprefixer: {
96+
postcss: {
9797
options: {
98-
browsers: [
99-
'last 2 version',
100-
'> 1%',
101-
'Edge >= 12',
102-
'Explorer >= 9',
103-
'Firefox ESR',
104-
'Opera 12.1'
98+
processors: [
99+
require('css-mqpacker')(), // combine media queries
100+
require('postcss-zindex')(), // reduce z-index values
101+
require('postcss-combine-duplicated-selectors')({ removeDuplicatedProperties: true }), // combine duplicate selectors
102+
require('autoprefixer')() // add vendor prefixes
105103
]
106104
},
107-
pack: {
108-
src: '<%= concat.css.dest %>',
109-
dest: '<%= concat.css.dest %>'
105+
dist: {
106+
src: '<%= concat.css.dest %>'
110107
}
111108
},
112109

@@ -357,8 +354,8 @@ module.exports = function(grunt) {
357354
'jekyll',
358355
'useminPrepare',
359356
'concat',
360-
'autoprefixer',
361357
'uncss',
358+
'postcss',
362359
'cssmin',
363360
'uglify',
364361
'filerev',
@@ -383,7 +380,7 @@ module.exports = function(grunt) {
383380
'jekyll',
384381
'useminPrepare',
385382
'concat',
386-
'autoprefixer',
383+
'postcss',
387384
'filerev',
388385
'usemin',
389386
'generate-sri',

package-lock.json

Lines changed: 154 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)