Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/garthdb/postcss-deduplicate
PostCSS plugin to remove duplicate class definitions
https://github.com/garthdb/postcss-deduplicate
Last synced: 3 months ago
JSON representation
PostCSS plugin to remove duplicate class definitions
- Host: GitHub
- URL: https://github.com/garthdb/postcss-deduplicate
- Owner: GarthDB
- License: apache-2.0
- Created: 2016-08-18T16:38:01.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-08-18T19:16:03.000Z (over 8 years ago)
- Last Synced: 2024-10-14T08:12:10.429Z (3 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PostCSS Deduplicate
[![Build Status](https://travis-ci.org/GarthDB/postcss-deduplicate.svg?branch=master)](https://travis-ci.org/GarthDB/postcss-deduplicate) [![Code Climate](https://codeclimate.com/github/GarthDB/postcss-deduplicate/badges/gpa.svg)](https://codeclimate.com/github/GarthDB/postcss-deduplicate) [![Test Coverage](https://codeclimate.com/github/GarthDB/postcss-deduplicate/badges/coverage.svg)](https://codeclimate.com/github/GarthDB/postcss-deduplicate/coverage) [![Issue Count](https://codeclimate.com/github/GarthDB/postcss-deduplicate/badges/issue_count.svg)](https://codeclimate.com/github/GarthDB/postcss-deduplicate/issues) [![Dependency Status](https://david-dm.org/GarthDB/postcss-deduplicate.svg)](https://david-dm.org/GarthDB/postcss-deduplicate) [![Inline docs](http://inch-ci.org/github/GarthDB/postcss-deduplicate.svg?branch=master)](http://inch-ci.org/github/GarthDB/postcss-deduplicate) [![npm version](https://badge.fury.io/js/postcss-deduplicate.svg)](https://badge.fury.io/js/postcss-deduplicate)
---
PostCSS plugin to remove duplicate class definitions. Based on [Kristofer Joseph](http://twitter.com/dam)'s [rework-deduplicate](https://github.com/kristoferjoseph/rework-deduplicate) plugin.
## Install
`npm i --save`
## Usage
```js
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:
```css
.button {
background: black;
}
.button {
background: red;
}
.button {
background: black;
}
```Output:
```css
.button {
background: black;
}
.button {
background: red;
}
```