Skip to content
This repository has been archived by the owner. It is now read-only.
DEPRECATED, see https://github.com/cssnano/cssnano | Discard duplicate rules in your CSS files with PostCSS.
JavaScript
Branch: master
Clone or download

Latest commit

Latest commit c80d008 Feb 26, 2017

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Fix potential crash on trimming undefined raw properties. Feb 26, 2017
.all-contributorsrc Update metadata. Feb 26, 2017
.babelrc Tidy up module. Feb 6, 2016
.editorconfig Initial commit. Mar 26, 2015
.gitignore Tidy up module. Feb 6, 2016
.travis.yml Update to ESLint 3. Jul 6, 2016
CHANGELOG.md Update metadata. Feb 26, 2017
LICENSE-MIT Add email to license file. Apr 7, 2015
README.md Update metadata. Feb 26, 2017
package.json 2.1.0 Feb 26, 2017

README.md

postcss-discard-duplicates Build Status NPM version Dependency Status

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

Thanks goes to these wonderful people (emoji key):


Ben Briggs

💻 📖 👀 ⚠️

Bogdan Chadkin

💻 👀 ⚠️

Lee Houghton

💻

Andy Jansson

💻 ⚠️

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT © Ben Briggs

You can’t perform that action at this time.