How to identify unused CSS definitions from multiple CSS files in a project

Viewed 182073

A bunch of CSS files were pulled in and now I'm trying to clean things up a bit.

How can I efficiently identify unused CSS definitions in a whole project?

3 Answers

Google Chrome Developer Tools has (a currently experimental) feature called CSS Overview which will allow you to find unused CSS rules.

To enable it follow these steps:

  1. Open up DevTools (Command+Option+I on Mac; Control+Shift+I on Windows)
  2. Head over to DevTool Settings (Function+F1 on Mac; F1 on Windows)
  3. Click open the Experiments section
  4. Enable the CSS Overview option

enter image description here

Related