1.0.1 • Published 8 years ago

postcss-deduplicate v1.0.1

Weekly downloads
6
License
Apache-2.0
Repository
github
Last release
8 years ago

PostCSS Deduplicate

Build Status Code Climate Test Coverage Issue Count Dependency Status Inline docs npm version


PostCSS plugin to remove duplicate class definitions. Based on Kristofer Joseph's rework-deduplicate plugin.

Install

npm i --save

Usage

var dedupe = require('postcss-deduplicate');
var read = require('fs').readFileSync;

var css = postcss([dedupe('')])
  .process(read('path/to/source.css', 'utf8'))
  .then(result => { console.log(result.css.toString()) });

Example

Input:

.button {
  background: black;
}
.button {
  background: red;
}
.button {
  background: black;
}

Output:

.button {
  background: black;
}
.button {
  background: red;
}