Forum Moderators: not2easy
Dust-Me Selectors is a Firefox extension (for v1.5 or later) that finds unused CSS selectors......
You'll end up with a profile of which selectors are not used anywhere on the site.
I have just installed this, so don't know how it works yet. It might still be in test phase - but I know many members have asked for something like this.
It should, by its description, be especially useful if you've taken over a legacy site and don't want to delete rules for fear that they may still be in use somewhere on the site!
With the find-as-you-type search feature for Firefox, as long as the page isn't big (I suppose this is mostly for larger pages, for serious web designers), you could just search the classes and IDs.. As mentioned: if no IDs or classes are used, then it's certainly handy though, even though that would be bad code.
Either it is useless or I am missing something here.
it's still in the beginning phase - and it really would benefit from a spidering capability - and reading the release blog post for it, that seems to be top of the list for next development :)
>>missing..
What you have to do, for the minute, is surf the site you're checking with the extension running it will pick up extra stylesheets and remove "unused" selectors from the 'data list' as they are found/used in the site (you can download this list into csv/excel to make it easier to read)
It's not ideal at the minute, I agree, as it's fairly impossible to manually surf every page of a very large site, however I found (testing on a small personal site) that it was easy enough for me to spot which pages I need to surf to in order to clear large parts of the list (e.g. - form css - visit a page that uses the reply form, image css - visit a page with images..)
what I got left with was 1 unused selector and all my form CSS (that's because I no longer have reply pages ;))
It should work well for spotting large chunks, but I agree it's not ideal as yet for spotting those one-off selectors that are perhaps still in use in a couple of outdated pages
but if it gets spidering capabilities it should be the bees knees ;)
[edited by: SuzyUK at 4:05 pm (utc) on Aug. 7, 2007]
a sidenote: at the minute this only works with linked/imported stylesheets or inline CSS - it doesn't work with embedded CSS (css in the <head> of the page)
[OT]
..even though that would be bad code
IMHO that would be good code ;) - no evidence of classitis in sight :)
If IE supported advanced selectors it would be possible to CSS a site with or without classnames providing the HTML is good/clean - suggestion: as an learning exercise you could try and custom CSS this site (not in IE of course!) using the existing HTML!
(warning: it will do your head in but it will show how custom CSS, as opposed to schoolbook perfect CSS, should work!)
the fact the add-on picks it up is good though!
[/OT]
[edited by: SuzyUK at 5:29 pm (utc) on Aug. 7, 2007]