Wed. February 3, 3:50:54 AM
Thnx! This addon looks awesome!
As a website grows so does its stylesheet. The problem is, the opposite is not true. As a pages get removed, seldom do the selectors in the external stylesheet. This becomes even worse with multiple employees, especially if people come and go. Enter CSS Usage.
Above is an example screenshot showing selectors in green that were found and selectors in red that were not. As a website is browsed, the tool will continue to re-analyze the stylesheet.
I found this Firebug extension a couple weeks ago and thought it was worth talking about. CSS Usage shows up as a tab within Firebug so if you don't have that extension yet, head over to Mozilla's addon site and download it - https://addons.mozilla.org/en-US/firefox/addon/1843
The jist of CSS Usage is to scan your stylesheet selectors and HTML to determine if each selector is used. Used selectors are colored in green while unused selectors are colored in red. Selectors previously found on other pages are colored in dark green
By default it will only analyze a page if you hit 'scan' but I like to turn on the auto-scan feature and just browse around my site for about 20 pages to give it a good mix of selectors. After that I had only a handful of selectors that were left unused. I took those selectors and did a site wide search to try to identify if they were used.
There are a few drawbacks with the addon. Currently it will only scan pages you visit. It does not have the ability to scan your entire site. Sites with 100's of pages may be difficult to scan with this tool. I also found the line numbering to be a bit flaky (as seen in my screenshot above).
Some great pros of this addon include cleaning up your stylesheets and reducing filesize. You can also save a little bandwidth by making them smaller in size.
Head over to the CSS Usage page on Mozilla's addon site and give it a try.
Tags: css, firefox ( Add Tag )
Thnx! This addon looks awesome!
Nice find, afraid it's pretty useless though unless it can scan a whole site :(
Looks like a really good plugin, which is exactly the kind of thing I need on one of my sites as I was about to go through all the selectors manually (there's a lot there that doesn't need to be).
I've been using Dust-Me, which is another Firefox extension, for years. IMO its the best around and, unlike this one, it can check an entire site.
It was released by Sitepoint and can be found at http://www.sitepoint.com/dustmeselectors/
Look forward to getting this to work.
I always use Firebug, so this would be great, yet, after installing new version, nothing has changed, no new features.
Agree w/Rob Brown (comment #2) ... without the ability to scan an entire domain, the addon falls short. (Instead, will look at Dust-Me.
It's a good plugin, and I've found it useful so far, but it is a bit dangerous. For instance, classes that are in hidden divs (to be revealed on a JavaScript click, for example) show as being unused. I've also seen other cases of it reporting a declaration unused, when in fact it is used.
It's good, but as they say, caveat emptor. I'll also check out this Dust-Me.
Site Coded And Designed By Neal Grosskopf Using No Crappy CMS Or Themes