News for hackers. Stuff that matters.
Re:Show HN: A Chrome extension that extracts used CSS and co... by tofof on Thursday August 09, 2018 @10:44AM (#17724598)
Personally, I use the PurifyCSS[1] and PurgeCSS[2] Grunt/Gulp/Webpack modules for this task.

https://github.com/purifycss/purifycss

https://github.com/FullHuman/purgecss

The Purge documentation claims that a third tool, UnCSS[3], may be even more accurate.

https://github.com/uncss

Re:Show HN: A Chrome extension that extracts used CSS and co... by gitgud on Saturday August 11, 2018 @09:12PM (#17742419)
Is there a tool which can intelligently reactor the rules in a CSS file?

So like combine all the same background colour references etc. I suppose this would require HTML changes too, but am interested to see if this has been done.

Re:Show HN: A Chrome extension that extracts used CSS and co... by Mtinie on Thursday August 09, 2018 @11:14AM (#17724852)
@tofof: Do you have a workflow which uses both of them the tools in series, or do you pick one or the other depending upon what you're doing? PurifyCSS and PurgeCSS, at least from a cursory review, appear to have similar functionality.
Re:Show HN: A Chrome extension that extracts used CSS and co... by tofof on Thursday August 09, 2018 @12:06PM (#17725413)
You're correct that they're very similar; PurgeCSS even describes itself as an improvement to PurifyCSS. (Purge tries to actually parse for matches, whereas Purify just looks for the presence of words -- so if you have a .arrow CSS rule in your framework, and you happen to use the word 'arrow' in body text somewhere, Purify will needlessly include that style in its output).

But yes, I actually use both tools in series. I get a small reduction from Purifying the output of Purge (I haven't actually bothered to diff it to see where), and Purify stitches the files together and minifies in addition to pruning.