I'm using gulp uncss. This is my task code:
gulp.task('uncss', () => {
return gulp.src($uncss.src)
.pipe(uncss({
html: JSON.parse(require('fs').readFileSync('./sitemap.json', 'utf-8')),
ignore: [/\.no-\w+/g, /\.is-\w+/g, /\.plyr\w+/g, /\.lazy\w+/g, /\.\w+\s?\.is-\w+/g]
}))
// .pipe(cssnano())
.on('error', handleErrors)
.pipe(gulp.dest($uncss.dest))
});
The following line
.is-menu-open .menu__btn span:before, .is-menu-open .menu__btn span:after {
background-color: #000;
}
is compiled as, once I've run the code through the gulp task above.
.is-menu-open .menu__btn span:before {
background-color: #000;
}
Any thoughts, my regex skills are some what lacking!
Essentially I need to ignore any classes with .is-
anywhere in the selector.
According to documentation: