Drupal: Searching for Unused CSS Selectors
There is a perfect Firefox add-on letting you search used CSS selectors: Dust-Me Selectors. In this article I would like to tell you about this.
Description of Dust-Me Selectors
Dust-Me Selectors is a Firefox extension which searches unused CSS selectors.
It retrieves all selectors from all style tables on a page you view, then it analyze this page to find unused selectors. The data is stored so when you test the further pages, selectors can cross.
You can test pages one by one or make analysis of the whole site. Thus you will do unused selectors’ profiling.
The main abilities
- Maintains local and remote style tables including
<link>
-elements,<?xml-stylesheet?>
(<?xml-stylesheet?>
processing instructions) and @import statements. (Pay attention: rules inside<style>
blocks which are not @import statements and inline-attributes of styles are not included.) - Maintains
<link>
style tables inside IE condition comments. - Checks a single page or the whole site.
- Understands all CSS1 selectors and the most of CSS2 and CSS3 selectors.
- Processes the main CSS hacks. For example, “* html #foo” would be converted to “html #foo“.