# UnCSS

Remove unused styles from CSS

Repository: https://github.com/uncss/uncss
Canonical: https://ross.abutalabs.com/products/uncss
Language: JavaScript
License: MIT
License Family: permissive
Topics: uncss, javascript, postcss, stylesheets, cleanup, build-tool, unusedcss, css
Last push: 2024-06-18T07:27:49+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4885, "days_push": 806, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 9402, forks 403 (observed 2026-08-28T04:10:31.033449+00:00)

## What it is
UnCSS is a Node.js tool and CLI that removes unused CSS selectors from stylesheets by loading HTML pages in jsdom, executing JavaScript, and filtering selectors via document.querySelector. It integrates with build pipelines (e.g., Grunt) and supports options like ignoring runtime-added classes.

## Use cases
- remove unused css from stylesheets
- optimize css file size for production build
- strip unused selectors from bootstrap css
- clean up css in a static site build
- find which css rules are never used on my pages
- reduce css payload for faster page load

## When to choose
- you have static HTML pages or rendered output and want to shrink CSS
- your build pipeline is Node.js-based (Grunt, npm scripts)
- you need to handle JavaScript-injected CSS on page load

## When to avoid
- your pages are templates (PHP, templating engines) rather than rendered HTML
- most of your CSS classes are added by JavaScript on user interaction
- you need a fully automated CSS purging solution for SPAs with dynamic routing

## Facets
- artifact type: cli-tool
- maturity: maintenance
- function: build-tool, css-framework, developer-tools
- domain: web-development, frontend, developer-tools, performance
- platform: cli, cross-platform
- tags: css-optimization, unused-css, postcss, jsdom, grunt-plugin, stylesheet-cleanup, nodejs

## Member repositories
- uncss/uncss (main) score 23
- uncss/grunt-uncss (plugin) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:31.033449+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:22:10.841406+00:00, confidence not recorded.
  - readme: https://github.com/uncss/uncss (fetched 2026-08-28T04:10:31.033449+00:00, sha df3621b4bae0)
  - registry_npm: https://registry.npmjs.org/uncss (fetched 2026-08-29T08:22:25.413633+00:00, sha aa32eb67c9cb)
- Data as of 2026-08-30T08:39:29.467469+00:00.
