postcss-minify-gradients

Minify gradient parameters with PostCSS.

MIT 52 个版本
安装
npm install postcss-minify-gradients
yarn add postcss-minify-gradients
pnpm add postcss-minify-gradients
bun add postcss-minify-gradients
README

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

版本列表
8.0.1 2026-06-11
8.0.0 2026-05-06
7.0.5 2026-05-02
7.0.4 2026-04-20
7.0.3 2026-04-13
7.0.2 2026-03-30
7.0.1 2025-05-06
7.0.0 2024-04-24
6.0.3 2024-03-06
6.0.2 2024-02-24
6.0.1 2023-12-14
6.0.0 2023-03-27
5.1.1 2022-03-21
5.1.0 2022-03-01
5.0.6 2022-02-07
5.0.5 2022-01-23
5.0.4 2022-01-07
5.0.3 2021-11-02
5.0.2 2021-08-18
5.0.1 2021-05-19
5.0.0-rc.2 2021-03-15
5.0.0-rc.1 2021-03-05
5.0.0-rc.0 2021-02-19
5.0.0 2021-04-10
4.0.2 2019-02-12
4.0.1 2018-09-24
4.0.0-rc.2 2017-08-06
4.0.0-rc.0 2017-06-01
4.0.0 2018-07-04
1.0.5 2016-11-01
1.0.4 2016-10-19
1.0.3 2016-06-14
1.0.2 2016-05-17
1.0.1 2015-12-07
1.0.0 2015-12-06