7 Principles Of Clean And Optimized CSS Code | CSS | Smashing Magazine
Why doesn't such a thing exist yet?
Surely it can't be too hard to write a script that crawls your entire site's source looking for instances of class="something" & id="something" then takes the results and checks the style sheet for #something or .something respectively.
This would be top of my list of things to create if I had the know-how.
There is one last type of application that can help prune CSS file size I’d like to mention. It can crawl a web site and log which CSS rules and declarations are not being applied, then bring these to your attention. Unfortunately, this tool hasn’t been invented yet, but I would gladly pay for such a application.
I can recall times when I’ve been afraid to delete certain rules because there is no documentation that explains to me that those selectors are leftover from previous iterations of development. If an app can bring those rules to my attention, that will help with maintenance and keeping CSS files lean.
Why doesn't such a thing exist yet?
Surely it can't be too hard to write a script that crawls your entire site's source looking for instances of class="something" & id="something" then takes the results and checks the style sheet for #something or .something respectively.
This would be top of my list of things to create if I had the know-how.