PurgeCSSPurgeCSS
API Reference
  • English
  • Français
GitHub
API Reference
  • English
  • Français
GitHub
PurgeCSS logo

Remove unused CSS.

PurgeCSS reads your content files, matches the selectors they use, and removes the rest of your CSS.

Get startedIntroduction

Reads your content

Extractors find the selectors used in your HTML, templates and JavaScript. Only the CSS that matches them is kept.

Fits your build

Run it from the command line, the JavaScript API, or plugins for PostCSS, webpack, Gulp, Grunt and Gatsby.

Keeps what you choose

Safelist selectors by name or pattern, and write your own extractor for any file type.

Sponsors

BairesDev - SponsorFull Human - Sponsor

Table of Contents

PurgeCSS

  • Configuration
  • Command Line Interface
  • Programmatic API
  • Safelisting
  • Extractors
  • Comparison

Plugins

  • PostCSS
  • Webpack
  • Gulp
  • Grunt
  • Gatsby

Guides

  • Vue.js
  • Nuxt.js
  • React.js
  • Angular
  • Next.js
  • Razzle
  • WordPress
  • Hugo

Common Questions

  • How to use with CSS modules?
  • How to use with Ant Design?
MIT Licensed · Copyright © 2018–present Full Human LTD