postcss-minify-gradients (5.1.1)

Published 2026-02-24 14:03:05 +00:00 by atheaadmin

Installation

registry=
npm install postcss-minify-gradients@5.1.1
"postcss-minify-gradients": "5.1.1"

About this package

postcss-minify-gradients

Minify gradient parameters with PostCSS.

Install

With npm do:

npm install postcss-minify-gradients

Example

Where possible, this module will minify gradient parameters. It can convert linear gradient directional syntax to angles, remove the unnecessary 0% and 100% start and end values, and minimise color stops that use the same length values (the browser will adjust the value automatically).

Input

h1 {
    background: linear-gradient(to bottom, #ffe500 0%, #ffe500 50%, #121 50%, #121 100%)
}

Output

h1 {
    background: linear-gradient(180deg, #ffe500, #ffe500 50%, #121 0, #121)
}

Usage

See the PostCSS documentation for examples for your environment.

Contributors

See CONTRIBUTORS.md.

License

MIT © Ben Briggs

Dependencies

Dependencies

ID Version
colord ^2.9.1
cssnano-utils ^3.1.0
postcss-value-parser ^4.2.0

Development Dependencies

ID Version
postcss ^8.2.15

Peer Dependencies

ID Version
postcss ^8.2.15

Keywords

css postcss postcss-plugin
Details
npm
2026-02-24 14:03:05 +00:00
1
Ben Briggs
MIT
latest
3.5 KiB
Assets (1)
Versions (1) View all
5.1.1 2026-02-24