In just a few lines, we compiled SCSS source into a single file, removed unusedCSS and minified the output!
Options
Please see theUnCSS documentationfor all of the options you can use.Some of them aren't as necessary when using gulp-uncss, because the CSS toanalyse comes from the stream rather than the HTML files. The main options youwill likely be using are:
html
Type:Array|StringRequired value.
An array which can contain an array of files relative to yourgulpfile.js, andwhich can also contain URLs. Note that if you are to pass URLs here, then thetask will take much longer to complete. If you want to pass some HTML directlyinto the task instead, you can specify it here as a string.
ignore
Type:ArrayDefault value:undefined
Selectors that should be left untouched by UnCSS as it can't detect userinteraction on a page (hover, click, focus, for example). Both literal names andregex patterns are recognized.
timeout
Type:IntegerDefault value:undefined
Specify how long to wait for the JS to be loaded.
Note thatoptions.ignoreSheetsisalready definedfor you. gulp-uncss willonly process CSS files in the stream.
Contributing
Pull requests are welcome. If you add functionality, then please add unit teststo cover it.