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

    • About PurgeCSS
    • Getting Started
    • Configuration
    • Command Line Interface
    • Programmatic API
    • Safelisting
    • Extractors
  • Plugins

    • PostCSS
    • Webpack
    • Gulp
    • Grunt
    • Gatsby
  • Guides

    • Vue
    • React
    • Angular
    • Next.js
    • Nuxt.js
    • Razzle
    • WordPress
    • Hugo
  • Comparison
  • Common Questions

    • How to use with CSS modules
    • How to use with Ant Design

Home > purgecss > VariablesStructure

VariablesStructure class

Signature:

export declare class VariablesStructure 

Properties

Property

Modifiers

Type

Description

nodes

Map<string, VariableNode[]>

properties

Map<string, postcss.AtRule[]>

safelist

StringRegExpArray

usedVariables

Set<string>

Methods

Method

Modifiers

Description

addProperty(atRule)

Register an @property at-rule so it can be removed along with the declarations of the variable it defines

addVariable(declaration)

addVariableUsage(declaration, matchedVariables)

addVariableUsageInProperties(matchedVariables)

isVariablesSafelisted(variable)

removeUnused()

setAsUsed(variableName)

Mark every declaration of the variable as used. The variables it uses are not marked, removeUnused adds them to the used variables first.