You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.0 KiB

4 years ago
  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