3 ms·
I've been looking for a CSS optimizer that will remove any styles that aren't actually used -- e.g. selectors matching ids and classes that don't exist in the h
by foobarbecue 3y ago
I've been looking for a CSS optimizer that will remove any styles that aren't actually used -- e.g. selectors matching ids and classes that don't exist in the html. Does anyone know of such a thing? Preferably easy to use from Jetbrains IDEs?
- gregod 3y agohttps://github.com/GoogleChromeLabs/critters https://github.com/GoogleChromeLabs/critters Might be a good starting point. It’s designed to inline the css afterward so it’s more focused on extracting used css than removing unused.
- iansinnott 3y agoCheck out: https://github.com/uncss/uncss https://github.com/uncss/uncss I've only used it once but it did the job (NOTE: Plain HTML, plain CSS, no build pipeline. So YMMV)
- c_s_guy 3y agoAs a starting point, Tailwind used to use PurgeCSS [0] but I'm not sure what they use now. [0] https://purgecss.com https://purgecss.com