S
S
smailenemy2016-04-07 18:58:53
css
smailenemy, 2016-04-07 18:58:53

How to properly configure gulp-uncss?

Hey everyone, I'm using gulp-uncss to remove unused properties in CSS.
Everything is fine, but only 2 classes are removed - visible and hidden , which are not in the html code, but they are in the js code.
How to be?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Leonid Knyazev, 2016-04-07
@amorphis

You can try like this, but to be honest, I did not check it myself:

.pipe(uncss({
    ignore: ['.visible', '.hidden']
}))

From the uncss documentation :
Options:
...
-i, --ignore Do not remove given selectors
...
And more from the documentation:
/* uncss:ignore */
.selector1 {
    /* this rule will be ignored */
}

.selector2 {
    /* this will NOT be ignored */
}

K
Konstantin Kitmanov, 2016-04-07
@k12th

ignore option

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question