# PurgeCSS

[BASE product page](<https://base.akulich.dev/en/library/purgecss/>) · [Resource](<https://github.com/FullHuman/purgecss>)

ID: purgecss · Language: en
Schema version: 1 · Data version: cbbe7123b47a5ae80983

This is editorial data. An unknown field neither confirms nor rules out a capability.
dataVersion is a dataset fingerprint, not evidence of a recent fact check.

Removes unused CSS rules based on content sources: it helps reduce website style output while preserving required dynamic classes\.

## Type

Build / code quality tool

## Entry type

tool

## Separate catalog

No

## [Access conditions](<https://base.akulich.dev/en/library/purgecss/#resource-access>)

free

## [What you can use for free](<https://base.akulich.dev/en/library/purgecss/#resource-access>)

Code and local use under MIT\.

## [Paid features and costs](<https://base.akulich.dev/en/library/purgecss/#resource-access>)

Computing resources, self\-hosting, and external services are paid for separately if used\.

## [Access and limitations](<https://base.akulich.dev/en/library/purgecss/#resource-access>)

Code and local use under MIT\. Computing resources, self\-hosting, and external services are paid for separately if used\.

## [Use cases](<https://base.akulich.dev/en/library/purgecss/#resource-tasks>)

- Reduce CSS output without losing used styles
- Add exceptions for dynamic classes and compare styles before and after cleanup

## Category IDs

- infrastructure
- quality

## Subcategory IDs

- infrastructure\.developer
- quality\.review

## Tags

- PurgeCSS
- build
- Development

## Also known as

- FullHuman/purgecss
- purge\-css
- css\-purge

## [Selection purpose](<https://base.akulich.dev/en/library/purgecss/#resource-selection>)

Reduce CSS output without losing used styles

## [Choose this when](<https://base.akulich.dev/en/library/purgecss/#resource-selection>)

- Reduce CSS output without losing used styles
- Add exceptions for dynamic classes and compare styles before and after cleanup

## [Requirements](<https://base.akulich.dev/en/library/purgecss/#resource-selection>)

- Set a safelist for dynamically generated classes; check PostCSS processing order for exclusion comments\.

## [Limitations](<https://base.akulich.dev/en/library/purgecss/#resource-selection>)

- Costs and limits of free use: Computing resources, self\-hosting, and external services are paid for separately if used\.
- Terms of use: MIT for the code; dependencies have separate licenses\.
- A CSS optimizer may remove the purgecss ignore comment before PurgeCSS reads it\.

## [Questions before use](<https://base.akulich.dev/en/library/purgecss/#resource-faq>)

### What can you use for free in PurgeCSS?

Code and local use under MIT\.

### What additional costs might arise with PurgeCSS?

Computing resources, self\-hosting, and external services are paid for separately if used\.

### What terms of use matter for PurgeCSS?

MIT for the code; dependencies have separate licenses\.

### How do you get started with PurgeCSS?

Specify content sources containing used CSS classes\. Add exceptions for dynamic classes and compare styles before and after cleanup\. Add the workflow to scripts or CI with a clear report\.

### Why didn't a purgecss ignore rule work in a production build?

The documentation warns that cssnano and other processors may remove CSS comments beforehand\. Use a preserved important comment such as /\*\! purgecss \.\.\. \*/ or adjust processing order\. Safelist also supports strings and standard, deep, and greedy regular expressions\.

## Sources for the selection guide

- [https://github\.com/FullHuman/purgecss](<https://github.com/FullHuman/purgecss>)
- [https://raw\.githubusercontent\.com/FullHuman/purgecss/HEAD/README\.md](<https://raw.githubusercontent.com/FullHuman/purgecss/HEAD/README.md>)
- [https://raw\.githubusercontent\.com/FullHuman/purgecss/HEAD/LICENSE](<https://raw.githubusercontent.com/FullHuman/purgecss/HEAD/LICENSE>)
- [https://www\.open\-source\-tools\.com/](<https://www.open-source-tools.com/>)
- [https://purgecss\.com/safelisting\.html](<https://purgecss.com/safelisting.html>)

## [Possible workflow](<https://base.akulich.dev/en/library/purgecss/#resource-scenario>)

Reduce CSS output without losing used styles\.

A possible workflow; this is not a report of hands-on testing.

## Before you start

- A repository, package manifests, and configuration\.
- A compatible runtime and the target build command\.

## Steps

1. Specify content sources containing used CSS classes\.
2. Add exceptions for dynamic classes and compare styles before and after cleanup\.
3. Add the workflow to scripts or CI with a clear report\.

## Check your result

- A clean copy of the project reproduces the result\.
- Errors produce a nonzero exit code and clear diagnostics\.

## [License](<https://base.akulich.dev/en/library/purgecss/#resource-license>)

MIT for the code; dependencies have separate licenses\.

## License explanations for the specified scope

### MIT — permissive license

You can use, modify, distribute, and sell the code, including in a closed\-source commercial product\. When sharing copies or substantial portions of the code, retain the license text and copyright notice\. You do not need to open\-source your entire project; the author provides no warranties\.

[License terms](<https://opensource.org/license/mit>)

## [Sources](<https://base.akulich.dev/en/library/purgecss/#resource-sources>)

- [Official source](<https://github.com/FullHuman/purgecss>)
- [Official source](<https://raw.githubusercontent.com/FullHuman/purgecss/HEAD/README.md>)
- [License](<https://raw.githubusercontent.com/FullHuman/purgecss/HEAD/LICENSE>)
- [Catalog / discovery source](<https://www.open-source-tools.com/>)
- [Official source](<https://purgecss.com/safelisting.html>)

## Editorial review date

2026\-10\-06

## Editorial review scope

The purpose, current repository license, and separate terms for code, services, and models have been reviewed\. The product was not run, and no security audit was performed\.

Dates refer to the stated editorial review, not hands-on testing, a product update, or a recent review of all sources.
