With PostCSS
Installation
Usage
In postcss.config.js
:
Using PostCSS API:
See [PostCSS] docs for examples for your environment.
Options
content
(required)
content
(required)Type: string | Object
You can specify content that should be analyzed by PurgeCSS with an array of filenames or globs. The files can be HTML, Pug, Blade, etc.
extractors
extractors
Type: Array<Object>
whitelist
whitelist
Type: Array<string>
You can whitelist selectors to stop PurgeCSS from removing them from your CSS. This can be accomplished with the options whitelist and whitelistPatterns.
whitelistPatterns
whitelistPatterns
Type: Array<RegExp>
You can whitelist selectors based on a regular expression with whitelistPatterns.
keyframes
keyframes
Type: boolean
Default value: false
If you are using a CSS animation library such as animate.css, you can remove unused keyframes by setting the keyframes option to true.
fontFace
fontFace
Type: boolean
Default value: false
If there are any unused @font-face rules in your css, you can remove them by setting the fontFace option to true.
Contributing
Versioning
License
Last updated