Clean unnecessary CSS with PurifyCSS
| Package | gulp-purifycss |
| Description | Clean unnecessary CSS |
| Node Version | >= 0.10 |
The (optional) options argument
Type: Object
Properties of options object:
minify: Set to true to minify. Default: false.
output: Filepath to write purified CSS to. Returns raw string if false. Default: false.
info: Logs info on how much CSS was removed if true. Default: false.
rejected: Logs the CSS rules that were removed if true. Default: false.
whitelist: Array of selectors to always leave in. Ex. ['button-active', '*modal*']`` this will leave any selector that includes modalin it and selectors that matchbutton-active`. (wrapping the string with *'s, leaves all selectors that include it)
var purify = require('gulp-purifycss');
gulp.task('css', function() {
return gulp.src('./public/app/example.css')
.pipe(purify(['./public/app/**/*.js', './public/**/*.html'], {options}))
.pipe(gulp.dest('./dist/'));
});