gulp-postcss-hover-media-grouper
v1.1.0
Published
Gulp wrapper for postcss-hover-media-grouper
Downloads
4
Readme
gulp-postcss-hover-media-grouper
Group :hover
selectors with postcss-media-hover-group
Usage
const gulp = require('gulp');
const sass = require('gulp-sass');
const clean = require('gulp-clean');
const sourcemaps = require('gulp-sourcemaps');
const autoprefixer = require('gulp-autoprefixer');
const hovermediagrouper = require('/home/suki/public_html/repos/gulp-postcss-hover-media-grouper');
// css autoprefixer config (the 'overrideBrowserslist' is for newer version)
const autoPrefixerConfig = {
'browsers': ['> 1%', 'last 2 version', 'ie 8', 'ie 9', 'Opera 12.1', 'Safari 7', 'iOS 7'],
'overrideBrowserslist': ['> 1%', 'last 2 version', 'ie 8', 'ie 9', 'Opera 12.1', 'Safari 7', 'iOS 7']
};
function cleanCss() {
return gulp
.src('assets/release/css/**/*', {read:false, allowEmpty: true})
.pipe(clean());
}
function compileCss() {
return gulp
.src('assets/dev/scss/**/*.scss', {allowEmpty: true})
.pipe(sourcemaps.init())
.pipe(sass()).on('error', sass.logError)
.pipe(autoprefixer(autoPrefixerConfig))
.pipe(hovermediagrouper())
.pipe(sourcemaps.write())
.pipe(gulp.dest('assets/release/css/'));
}
function watch() {
gulp.watch('assets/dev/scss/**/*.scss', gulp.parallel(compileCss));
}
gulp.task('styles', gulp.series(cleanCss, compileCss));
gulp.task('default', watch);