Gathering detailed insights and metrics for @csstools/postcss-gradients-interpolation-method
Gathering detailed insights and metrics for @csstools/postcss-gradients-interpolation-method
Gathering detailed insights and metrics for @csstools/postcss-gradients-interpolation-method
Gathering detailed insights and metrics for @csstools/postcss-gradients-interpolation-method
PostCSS Tools and Plugins
npm install @csstools/postcss-gradients-interpolation-method
Typescript
Module System
Min. Node Version
Node Version
NPM Version
97.7
Supply Chain
99.4
Quality
88.1
Maintenance
100
Vulnerability
100
License
CSS (43.25%)
JavaScript (30.24%)
TypeScript (22.9%)
HTML (3.03%)
Nunjucks (0.48%)
Shell (0.1%)
Total Downloads
96,701,914
Last Day
60,569
Last Week
1,461,511
Last Month
6,244,841
Last Year
60,621,404
MIT-0 License
981 Stars
4,379 Commits
78 Forks
9 Watchers
6 Branches
132 Contributors
Updated on Jun 30, 2025
Minified
Minified + Gzipped
Latest Version
5.0.10
Package Id
@csstools/postcss-gradients-interpolation-method@5.0.10
Unpacked Size
20.97 kB
Size
5.93 kB
File Count
7
NPM Version
10.9.0
Node Version
22.12.0
Published on
May 27, 2025
Cumulative downloads
Total Downloads
Last Day
-3.2%
60,569
Compared to previous day
Last Week
-4.7%
1,461,511
Compared to previous week
Last Month
-0.1%
6,244,841
Compared to previous month
Last Year
79.1%
60,621,404
Compared to previous year
npm install @csstools/postcss-gradients-interpolation-method --save-dev
PostCSS Gradients Interpolation Method lets you use different interpolation methods in CSS gradient functions following CSS Images Module 4.
1.example { 2 background-image: linear-gradient(in oklch, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%); 3} 4 5:root { 6 --background-image: linear-gradient(in oklab, hsl(96, 42%, 24%) 0%, hsl(302, 67%, 25%) 100%); 7} 8 9/* becomes */ 10 11.example { 12 background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(248, 146, 114), rgb(244, 158, 94), rgb(235, 171, 82), rgb(220, 185, 81), rgb(201, 199, 95), rgb(177, 211, 118), rgb(151, 221, 146), rgb(125, 229, 177), rgb(103, 235, 208), rgb(94, 237, 237) 100%); 13 background-image: linear-gradient(in oklch, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%); 14} 15 16:root { 17 --background-image: linear-gradient(rgb(56, 87, 35) 0%, rgb(64, 83, 46), rgb(70, 79, 54), rgb(76, 74, 62), rgb(82, 69, 68), rgb(86, 64, 75), rgb(91, 58, 81), rgb(95, 51, 87), rgb(99, 44, 93), rgb(103, 34, 98), rgb(106, 21, 104) 100%); 18} 19 20@supports (background: linear-gradient(in oklch, red 0%, red 0% 1%, red 2%)) { 21:root { 22 --background-image: linear-gradient(in oklab, hsl(96, 42%, 24%) 0%, hsl(302, 67%, 25%) 100%); 23} 24}
[!CAUTION] Color stops with only a color or only an interpolation hint are not supported.
For best results you should always provide at least the color and position for each color stop. Double position color stops are supported.
1.foo { 2 /* Only a color: can't transform */ 3 background-image: linear-gradient(in oklch, black 0%, green, blue 100%); 4 5 /* Only an interpolation hint: can't transform */ 6 background-image: linear-gradient(in oklch, black 0%, 25%, blue 100%); 7}
[!CAUTION] Variable colors are not supported. We can not mix colors when the color is a variable.
1.foo { 2 --red: red; 3 /* Color stop variable : can't transform */ 4 background-image: linear-gradient(in oklch, black 0%, var(--red), blue 100%); 5}
Add PostCSS Gradients Interpolation Method to your project:
1npm install postcss @csstools/postcss-gradients-interpolation-method --save-dev
Use it as a PostCSS plugin:
1const postcss = require('postcss'); 2const postcssGradientsInterpolationMethod = require('@csstools/postcss-gradients-interpolation-method'); 3 4postcss([ 5 postcssGradientsInterpolationMethod(/* pluginOptions */) 6]).process(YOUR_CSS /*, processOptions */);
The preserve
option determines whether the original notation
is preserved. By default, it is preserved.
1postcssGradientsInterpolationMethod({ preserve: false })
1.example { 2 background-image: linear-gradient(in oklch, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%); 3} 4 5:root { 6 --background-image: linear-gradient(in oklab, hsl(96, 42%, 24%) 0%, hsl(302, 67%, 25%) 100%); 7} 8 9/* becomes */ 10 11.example { 12 background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(248, 146, 114), rgb(244, 158, 94), rgb(235, 171, 82), rgb(220, 185, 81), rgb(201, 199, 95), rgb(177, 211, 118), rgb(151, 221, 146), rgb(125, 229, 177), rgb(103, 235, 208), rgb(94, 237, 237) 100%); 13} 14 15:root { 16 --background-image: linear-gradient(rgb(56, 87, 35) 0%, rgb(64, 83, 46), rgb(70, 79, 54), rgb(76, 74, 62), rgb(82, 69, 68), rgb(86, 64, 75), rgb(91, 58, 81), rgb(95, 51, 87), rgb(99, 44, 93), rgb(103, 34, 98), rgb(106, 21, 104) 100%); 17}
The enableProgressiveCustomProperties
option determines whether the original notation
is wrapped with @supports
when used in Custom Properties. By default, it is enabled.
[!NOTE] We only recommend disabling this when you set
preserve
tofalse
or if you bring your own fix for Custom Properties.
See what the plugin does in its README.
1postcssGradientsInterpolationMethod({ enableProgressiveCustomProperties: false })
1.example { 2 background-image: linear-gradient(in oklch, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%); 3} 4 5:root { 6 --background-image: linear-gradient(in oklab, hsl(96, 42%, 24%) 0%, hsl(302, 67%, 25%) 100%); 7} 8 9/* becomes */ 10 11.example { 12 background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(248, 146, 114), rgb(244, 158, 94), rgb(235, 171, 82), rgb(220, 185, 81), rgb(201, 199, 95), rgb(177, 211, 118), rgb(151, 221, 146), rgb(125, 229, 177), rgb(103, 235, 208), rgb(94, 237, 237) 100%); 13 background-image: linear-gradient(in oklch, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%); 14} 15 16:root { 17 --background-image: linear-gradient(rgb(56, 87, 35) 0%, rgb(64, 83, 46), rgb(70, 79, 54), rgb(76, 74, 62), rgb(82, 69, 68), rgb(86, 64, 75), rgb(91, 58, 81), rgb(95, 51, 87), rgb(99, 44, 93), rgb(103, 34, 98), rgb(106, 21, 104) 100%); 18 --background-image: linear-gradient(in oklab, hsl(96, 42%, 24%) 0%, hsl(302, 67%, 25%) 100%); 19}
Custom properties do not fallback to the previous declaration
No vulnerabilities found.
Reason
30 commit(s) and 8 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
1 existing vulnerabilities detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
branch protection is not maximal on development and all release branches
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 1/24 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More