I am thinking of doing a CSS cleanup on my application to remove the unused code and make everything more organized.
Is there any way to identify the unused classes written in the CSS without manually checking everything?
Using cssnano Because in React.js projects each component has its own CSS file. It's a bit harder to detect unused CSS especially when each state has its own CSS rules and you can't render components with all states showing at the same time.
In non-React.js project purifyCSS has done the best job so far.
Stephan de Vries
Full stack developer, enthusiastic about new technologies.
There are actually great libraries that make this possible like PurifyCSS and UnCSS.
I've used UnCSS for a production website and it worked really great. It's very easy to setup and it doesn't take much time to get what you need. Try it out!