postcss-discard-duplicates (5.1.0)

Published 2026-02-24 14:02:53 +00:00 by atheaadmin

Installation

registry=
npm install postcss-discard-duplicates@5.1.0
"postcss-discard-duplicates": "5.1.0"

About this package

postcss-discard-duplicates

Discard duplicate rules in your CSS files with PostCSS.

Install

With npm do:

npm install postcss-discard-duplicates --save

Example

This module will remove all duplicate rules from your stylesheets. It works on at rules, normal rules and declarations. Note that this module does not have any responsibility for normalising declarations, selectors or whitespace, so that it considers these two rules to be different:

h1, h2 {
    color: blue;
}

h2, h1 {
    color: blue;
}

It has to assume that your rules have already been transformed by another processor, otherwise it would be responsible for too many things.

Input

h1 {
    margin: 0 auto;
    margin: 0 auto
}

h1 {
    margin: 0 auto
}

Output

h1 {
    margin: 0 auto
}

Usage

See the PostCSS documentation for examples for your environment.

Contributors

See CONTRIBUTORS.md.

License

MIT © Ben Briggs

Dependencies

Development Dependencies

ID Version
postcss ^8.2.15

Peer Dependencies

ID Version
postcss ^8.2.15

Keywords

css dedupe optimise postcss postcss-plugin
Details
npm
2026-02-24 14:02:53 +00:00
0
Ben Briggs
MIT
latest
2.8 KiB
Assets (1)
Versions (1) View all
5.1.0 2026-02-24