postcss-dropdupedvars

2.1.0 • Public • Published

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;
}

/postcss-dropdupedvars/

    Package Sidebar

    Install

    npm i postcss-dropdupedvars

    Weekly Downloads

    8

    Version

    2.1.0

    License

    Apache-2.0

    Unpacked Size

    17.7 kB

    Total Files

    8

    Last publish

    Collaborators

    • garthdb
    • lazd
    • patrickfulton
    • castastrophe