1 | # [postcss][postcss]-discard-empty [![Build Status](https://travis-ci.org/ben-eb/postcss-discard-empty.svg?branch=master)][ci] [![NPM version](https://badge.fury.io/js/postcss-discard-empty.svg)][npm] [![Dependency Status](https://gemnasium.com/ben-eb/postcss-discard-empty.svg)][deps]
|
2 |
|
3 | > Discard empty rules and values with PostCSS.
|
4 |
|
5 | Install via [npm](https://npmjs.org/package/postcss-discard-empty):
|
6 |
|
7 | ```
|
8 | npm install postcss-discard-empty --save
|
9 | ```
|
10 |
|
11 | ## Example
|
12 |
|
13 | ```js
|
14 | var postcss = require('postcss')
|
15 | var empty = require('postcss-discard-empty');
|
16 |
|
17 | var css = '@font-face; h1 {} {color:blue} h2 {color:} h3 {color:red}';
|
18 | console.log(postcss(empty()).process(css).css);
|
19 |
|
20 | // => 'h3 {color:red}'
|
21 | ```
|
22 |
|
23 | For more examples see the [tests](test.js).
|
24 |
|
25 | ## Contributing
|
26 |
|
27 | Pull requests are welcome. If you add functionality, then please add unit tests
|
28 | to cover it.
|
29 |
|
30 | ## License
|
31 |
|
32 | MIT © Ben Briggs
|
33 |
|
34 | [ci]: https://travis-ci.org/ben-eb/postcss-discard-empty
|
35 | [deps]: https://gemnasium.com/ben-eb/postcss-discard-empty
|
36 | [npm]: http://badge.fury.io/js/postcss-discard-empty
|
37 | [postcss]: https://github.com/postcss/postcss
|