3 ms·
Neat. There's also a Firebug extension that does this: https://addons.mozilla.org/en-us/firefox/addon/css-usage/ https://addons.mozilla.org/en-us/firefox/addon
by eli 12y ago
Neat. There's also a Firebug extension that does this: https://addons.mozilla.org/en-us/firefox/addon/css-usage/ https://addons.mozilla.org/en-us/firefox/addon/css-usage/ A little rough around the edges, but it works.
The challenge, of course, is that's it's hard to say for sure that something is unused. Maybe it's only called on one page, or only after some interaction with javascript on the page.
- alex_doom 12y ago>only after some interaction with javascript on the page That's why I will use a prefix js-[something] for elements that will interact with javascript and then user other classes for style so nothing gets removed by accident by others.
- eli 12y agoSmart. I end up grepping the whole codebase by hand for each class I want to remove, but even that isn't perfect.