8a090bf2c27c126052ee948b3782b95dd7039fda57ab135086f9b1c08772ad2625ac542a1b9e27e0d3cf973c2360d941d53e6c90cb85f246c6857015078117 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # [postcss][postcss]-minify-gradients
  2. > Minify gradient parameters with PostCSS.
  3. ## Install
  4. With [npm](https://npmjs.org/package/postcss-minify-gradients) do:
  5. ```
  6. npm install postcss-minify-gradients
  7. ```
  8. ## Example
  9. Where possible, this module will minify gradient parameters. It can convert
  10. linear gradient directional syntax to angles, remove the unnecessary `0%` and
  11. `100%` start and end values, and minimise color stops that use the same length
  12. values (the browser will adjust the value automatically).
  13. ### Input
  14. ```css
  15. h1 {
  16. background: linear-gradient(to bottom, #ffe500 0%, #ffe500 50%, #121 50%, #121 100%)
  17. }
  18. ```
  19. ### Output
  20. ```css
  21. h1 {
  22. background: linear-gradient(180deg, #ffe500, #ffe500 50%, #121 0, #121)
  23. }
  24. ```
  25. ## Usage
  26. See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
  27. examples for your environment.
  28. ## Contributors
  29. See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
  30. ## License
  31. MIT © [Ben Briggs](http://beneb.info)
  32. [postcss]: https://github.com/postcss/postcss