UNPKG

1.52 kBMarkdownView Raw
1# [postcss][postcss]-minify-gradients [![Build Status](https://travis-ci.org/ben-eb/postcss-minify-gradients.svg?branch=master)][ci] [![NPM version](https://badge.fury.io/js/postcss-minify-gradients.svg)][npm] [![Dependency Status](https://gemnasium.com/ben-eb/postcss-minify-gradients.svg)][deps]
2
3> Minify gradient parameters with PostCSS.
4
5## Install
6
7With [npm](https://npmjs.org/package/postcss-minify-gradients) do:
8
9```
10npm install postcss-minify-gradients
11```
12
13
14## Example
15
16Where possible, this module will minify gradient parameters. It can convert
17linear gradient directional syntax to angles, remove the unnecessary `0%` and
18`100%` start and end values, and minimise color stops that use the same length
19values (the browser will adjust the value automatically).
20
21### Input
22
23```css
24h1 {
25 background: linear-gradient(to bottom, #ffe500 0%, #ffe500 50%, #121 50%, #121 100%)
26}
27```
28
29### Output
30
31```css
32h1 {
33 background: linear-gradient(180deg, #ffe500, #ffe500 50%, #121 0, #121)
34}
35```
36
37
38## Usage
39
40See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
41examples for your environment.
42
43
44## Contributing
45
46Pull requests are welcome. If you add functionality, then please add unit tests
47to cover it.
48
49
50## License
51
52MIT © [Ben Briggs](http://beneb.info)
53
54
55[ci]: https://travis-ci.org/ben-eb/postcss-minify-gradients
56[deps]: https://gemnasium.com/ben-eb/postcss-minify-gradients
57[npm]: http://badge.fury.io/js/postcss-minify-gradients
58[postcss]: https://github.com/postcss/postcss