UnCSS – removes unused CSS from stylesheets

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:

  1. The HTML files are loaded by jsdom and JavaScript is executed.
  2. All the stylesheets are parsed by PostCSS.
  3. document.querySelector filters out selectors that are not found in the HTML files.
  4. 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
PrettierOpinionated code formatter
Oxfmt Tools for JavaScript and TypeScript
CSScombCoding style formatter for CSS
UnCSSRemoves unused CSS from stylesheets
MalvaFast formatter for CSS, SCSS, Sass and Less
laxCollection of fast formatters
csscssCSS redundancy analyzer

Read our verdict in the software roundup.


Best Free and Open Source Software 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.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted