UnCSS
UnCSS: Removes Unused CSS
UnCSS is a tool that analyzes HTML files and CSS stylesheets to remove unused CSS rules, providing a more efficient and streamlined user experience.
What is UnCSS?
UnCSS is an open source tool that removes unused CSS from stylesheets. It analyzes HTML files and the CSS files that apply to them, then removes any CSS rules that are not used by the HTML.
UnCSS works by crawling the HTML files and building a stylesheet containing only the CSS rules that are actually used. It parses the files to detect classes, IDs and element names used in the HTML. It also executes JavaScript on the pages in order to detect CSS rules applied dynamically.
By removing unused CSS, UnCSS can greatly reduce stylesheet file sizes. This helps pages load faster by minimizing the amount of CSS that needs to be downloaded. It also cleans up CSS files by getting rid of obsolete rules and clutter.
UnCSS can be installed as an NPM module and run from the command line. It has plugins for Grunt and Gulp available as well. UnCSS has options to ignore certain class names or elements from removal. It can also keep a whitelist of selectors that should not be removed.
Overall, UnCSS is a useful optimization tool for cleaning and streamlining stylesheets. It removes unused CSS automatically without needing manual stylesheet audits and tweaking.
UnCSS Features
Features
- Removes unused CSS rules from stylesheets
- Analyzes HTML files and applied CSS files
- CLI and Node.js API available
- Supports processing multiple files
- Handles @import rules
- Ignores CSS rules from user-defined selectors
Pricing
- Open Source
Pros
Cons
Official Links
Reviews & Ratings
Login to ReviewThe Best UnCSS Alternatives
View all UnCSS alternatives with detailed comparison →
Top Development and Css and other similar apps like UnCSS
Here are some alternatives to UnCSS:
Suggest an alternative ❐PurifyCSS
Helium CSS
Purgecss
UCSS
DropCSS