It'll be very helpful if in PostCSS there will be some plugin to remove unused styles like in UnCSS. Can we do something like this using PostCSS and maybe something like PostHTML?
Because using UnCSS after PostCSS works very slow and Gulpfile.js looks dirty:
var gulp = require('gulp');
var nano = require('gulp-cssnano');
var postcss = require('gulp-postcss');
var uncss = require('gulp-uncss');
gulp.task('postcss', function () {
var processors = [
// list of many plugins
];
return gulp.src('src/css/*.css')
.pipe(postcss(processors))
.pipe(uncss({
html: ['dist/index.html']
}))
.pipe(nano())
.pipe(gulp.dest('dist/css/'))
.pipe(browserSync.stream());
});
/cc @ben-eb
UnCSS uses PostCSS now.
https://github.com/giakki/uncss/blob/master/package.json#L44
@ben-eb Awesome!
Most helpful comment
UnCSS uses PostCSS now.
https://github.com/giakki/uncss/blob/master/package.json#L44