views:

1175

answers:

3

I would like to remove all unused css selectors from a common css file. While the Firefox extension "Dust Me Selectors" works well, it only works per page. It reports unused selectors for a page but some could be used on other pages.

Is there a tool which can go through a folder, scan all the files and bring up a list of selectors which are not used anywhere?

+3  A: 

I'm not sure why you can't use Dust Me Selectors, you can right-click on the symbol and select "Spider Sitemap" to do an entire website at once.

Daniel Lew
It works if I have a sitemap or the pages are linked. In some cases I don't have these.
Abdu
@abdu, then you should build one. All sites should have one for google (I mean searchengines) anyway.
Pim Jager
A: 

when i said for one page it reported 55 were used... when i ran spider using the same url (has 9 links) it reported 4 were used...

+1  A: 

It appears to me that Dust-Me doesn't really "spider", to the extent that it only follows the links it is given in the site map; it doesn't continue by following the next level of links contained in those pages. So you site map has to be complete. I also have a concern that Dust-Me is only concerned with unused selectors in the HTML. I'm working on a project where some selectors in the CSS are used in Javascript, but are not mentioned directly in the HTML.

Tom