10

I've come in at the end of a big Drupal site build, and the resulting CSS files are... verbose and less than tidy, to say the least!

Are there any tools for checking the entire site to a) see if there are unused styles and b) how often styles are used (and thus assist in refactoring them).

I've had a look at the CSS Roundup Firefox Addon but this relies on manually clicking through all the pages and I want to make sure I don't delete any in-use styles.

Edit: found existing post on Stack Overflow entitled How can I find unused images and CSS styles in a website? and this What tool can analyze my site and report on unused / unneeded CSS?

Community
  • 1
  • 1
Jake Rayson
  • 921
  • 7
  • 20
  • +1 I don't know of any tools to do this. It would require having to crawl the entire website, deal with crappy markup (potentially) and then parse CSS and expressions to find out if something isn't used. Quite complex. The best bet would be to use a browser engine already there, but I have no experience in that area. – Levi Morrison Nov 28 '11 at 16:23
  • possible duplicate of [css - find unused css](http://stackoverflow.com/questions/6650146/css-find-unused-css) – Fenton Nov 28 '11 at 16:28

1 Answers1

2

csslint can help, though i can't say it'll do everything you want

http://csslint.net/

albert
  • 8,112
  • 3
  • 47
  • 63
  • Yep, had a brief look at that, good as far as it goes but like @Levi says, would need to crawl entire site to see where rules being used. – Jake Rayson Nov 28 '11 at 16:29