Created
May 18, 2015 16:13
-
-
Save mistakster/6cfdf78e65ba056f50f7 to your computer and use it in GitHub Desktop.
Gulp task to unwrap @media rules to make “mobile first” styles IE8 friendly.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var less = require('gulp-less'); | |
var postcss = require('gulp-postcss'); | |
var rename = require('gulp-rename'); | |
var unwrapAtMedia = require('postcss-unwrap-at-media'); | |
gulp.task('default', function () { | |
return gulp.src('./src/**/*.less') | |
.pipe(less()) | |
.pipe(gulp.dest('./dist/')) | |
.pipe(postcss([ unwrapAtMedia ])) | |
.pipe(rename({ suffix: '.ie8' })) | |
.pipe(gulp.dest('./dist/')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment