Skip to content

Comment on Uncss – Find unused CSS

Comments

Most of us are using CSS precompilers (Less, Sass, Stylus) and then stitching tons of files together into a single .css file. I wonder if there is an easy way to produce Sass/Less/Stylus files with the un-used classes removed.

It would be sweet to have a grunt plugin that scans your CSS and templates and removes unused rules. It would probably have to read JS files to be thorough though.

Certainly possible with sourcemaps to essentially get a code coverage-like view for your precompiled styles. I havent' seen it done yet, however.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.