Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

stylesheet "profiler"

Does anyone know of software or a webservice that can read your stylesheet and html/php, and profile your CSS? By that I mean indicating which clauses or rules are never used, and so on.

After doing several serious redesigns on a fairly complex website, I'm sure there are some old skeletons hiding away, making my code clunkier and less readable, doing absolutely nothing, setting rules for divs and spans long since removed.

like image 996
Mala Avatar asked Sep 09 '10 05:09

Mala


Video Answer


2 Answers

The 'Dust-Me Selectors' Firefox plugin is quite helpful for finding unused rules, it can test individual pages and spider entire sites.

like image 57
Richard M Avatar answered Sep 26 '22 23:09

Richard M


Well, I've found something interesting. Using the "Audits" tool as part of the Chrome developer tools, you can find out which CSS rulesets are extraneous.

alt text

It's quite basic - it doesn't even point to the line number each of these rules are located from, but it is better than nothing. Hope this helps.

like image 32
Yi Jiang Avatar answered Sep 23 '22 23:09

Yi Jiang