News for hackers. Stuff that matters.
Re:Optimize CSS with SAT Solving by foobarbecue on Sunday March 17, 2024 @07:22PM (#39738971)
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?
Re:Optimize CSS with SAT Solving by gregod on Sunday March 17, 2024 @08:15PM (#39739264)
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.
Re:Optimize CSS with SAT Solving by iansinnott on Sunday March 17, 2024 @10:54PM (#39740146)
Check out: 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)

Re:Optimize CSS with SAT Solving by c_s_guy on Monday March 18, 2024 @12:32AM (#39740536)
As a starting point, Tailwind used to use PurgeCSS [0] but I'm not sure what they use now.

[0] https://purgecss.com