Topic: how to detect unused css classes/ids (Page 1 of 1) |
|
---|---|
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
posted 09-20-2008 17:48 |
Paranoid (IV) Inmate From: Norway |
posted 09-20-2008 18:17
You could use a browser supporting or a JS framework replicating querySelectorAll() and go through the selectors in your stylesheets. If a call returns an empty collection, you've got a winner. |
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
posted 09-20-2008 18:30 |
Paranoid (IV) Inmate From: Norway |
posted 09-20-2008 19:08
That API is quite recent. There isn't many [stable] browser supporting it. The fastest way is certainly to go with jQuery or any similar framework. |
Paranoid (IV) Inmate From: Norway |
posted 09-20-2008 19:20
Check slickspeed to see if the browsers you have have native support for the selector API. |
Paranoid (IV) Inmate From: A graveyard of dreams |
posted 09-21-2008 18:58
You could also have a look at the Dust-Me Selectors addon to Firefox. It gives you a nice list of all unused CSS-selectors on a given page. |
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
posted 09-23-2008 22:38 |
Bipolar (III) Inmate From: Phoenix |
posted 09-28-2008 10:17
Wow, great tool! |