Можно попробовать вот так, но если честно, сам не проверял:
.pipe(uncss({
ignore: ['.visible', '.hidden']
}))
Из
документации к uncss:
Options:
...
-i, --ignore Do not remove given selectors
...
И ещё из документации:
ignore (Array): provide a list of selectors that should not be removed by UnCSS. For example, styles added by user interaction with the page (hover, click), since those are not detectable by UnCSS yet. Both literal names and regex patterns are recognized. Otherwise, you can add a comment before specific selectors:
/* uncss:ignore */
.selector1 {
/* this rule will be ignored */
}
.selector2 {
/* this will NOT be ignored */
}