2.1.0 • Published 1 year ago

postcss-dropdupedvars v2.1.0

Weekly downloads
7
License
Apache-2.0
Repository
github
Last release
1 year ago

postcss-dropdupedvars

Drop duplicate custom properties

Installation

npm install postcss-dropdupedvars
postcss -u postcss-dropdupedvars -o dist/index.css src/index.css

Usage

Assuming you have some variables defined that are overridden in the same rule:

:root {
  --prefix-component-background-color: blue;

  --prefix-component-width: 10px;
  --prefix-component-height: 10px;
  --prefix-component-size: 10px;

  --prefix-component-width: 12px;
  --prefix-component-height: 12px;
}

The the overridden definitions will be removed from output:

:root {
  --prefix-component-background-color: blue;
  --prefix-component-size: 10px;

  --prefix-component-width: 12px;
  --prefix-component-height: 12px;
}