Home > purgecss > Options

Options interface

Options used by PurgeCSS to remove unused CSS Those options are used internally

Signature:

export interface Options 

Properties

PropertyModifiersTypeDescription
blocklistStringRegExpArrayBlocklist will block the CSS selectors from appearing in the final output CSS. The selectors will be removed even when they are seen as used by PurgeCSS.
contentArray<string | RawContent>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.
cssArray<string | RawCSS>Similar to content, you can specify css that should be processed by PurgeCSS with an array of filenames or globs
defaultExtractorExtractorFunction
dynamicAttributesstring[]Option to add custom CSS attribute selectors like "aria-selected", "data-selected", ...etc.
extractorsArray<Extractors>
fontFacebooleanIf there are any unused @font-face rules in your css, you can remove them by setting the fontFace option to true.
keyframesboolean
output?string(Optional)
rejectedboolean
rejectedCssboolean
safelistRequired<ComplexSafelist>You can indicate which selectors are safe to leave in the final CSS. This can be accomplished with the option safelist.
skippedContentGlobsArray<string>If you provide globs for the content parameter, you can use this option to exclude certain files or folders that would otherwise be scanned. Pass an array of globs matching items that should be excluded. (Note: this option has no effect if content is not globs.)
sourceMapboolean | (postcss.SourceMapOptions & { to?: string; })
stdinboolean
stdoutboolean
variablesboolean