Are there any good approaches to help identify unused css definitions in a project? A bunch of css files were pulled in and now I'm trying to clean things up a bit.
相关问题
- Adding a timeout to a render function in ReactJS
-
Why does the box-shadow property not apply to a
- Faster loop: foreach vs some (performance of jsper
- Why wrapping a function into a lambda potentially
- Add animation to jQuery function Interval
Chrome Developer Tools has an Audits tab which can show unused CSS selectors.
Run an audit, then, under Web Page Performance see Remove unused CSS rules
Check out Google's PageSpeed for Firefox. It does this, and a whole load more.
Apparently a Chrome plugin is under development as well.
CSS Usage
Firebug extension to view which CSS rules are actually used.
CSS Usage is an extension for Firebug (thus necessary to have Firebug installed) that allows you to know unused CSS style rules. It identifies the CSS you use and don’t use. It enables you to point out what unnecessary parts can be removed. You should definitely use this add-on to keep your CSS files as lightweight as possible.