Hacker News new | past | comments | ask | show | jobs | submit login

PurifyCSS does that: https://github.com/purifycss/purifycss

The only issue I have come across is when you are inserting elements with CSS classes using JavaScript. A workaround for this is importing the CSS in the JS module you are using it in via webpack or PurifyCSS also has an option to manually exclude certain selectors.




As you mention, It does if you somehow click every combination of buttons, invoke every error, corner case, etc. It can't know about HTML that isn't there, but could be.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: