UnCSS is a tool that removes unused CSS from your stylesheets. It works across multiple files and supports Javascript-injected CSS.
The process by which UnCSS removes the unused rules is as follows:
- The HTML files are loaded by jsdom and JavaScript is executed.
- All the stylesheets are parsed by PostCSS.
- document.querySelector filters out selectors that are not found in the HTML files.
- The remaining rules are converted back to CSS.
This is free and open source software.
Website: github.com/uncss/uncss
Support:
Developer: Giacomo Martino
License: MIT License
UnCSS is written in JavaScript. Learn JavaScript with our recommended free books and free tutorials.
Related Software
| CSS Code Formatters | |
|---|---|
| Prettier | Opinionated code formatter |
| Oxfmt | Tools for JavaScript and TypeScript |
| CSScomb | Coding style formatter for CSS |
| UnCSS | Removes unused CSS from stylesheets |
| Malva | Fast formatter for CSS, SCSS, Sass and Less |
| lax | Collection of fast formatters |
| csscss | CSS redundancy analyzer |
Read our verdict in the software roundup.
Explore our carefully curated directory of recommended free and open source software, covering every major software category.The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more. Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form. |


Please read our Comment Policy before commenting.