Gathering detailed insights and metrics for @csstools/postcss-color-function
Gathering detailed insights and metrics for @csstools/postcss-color-function
Gathering detailed insights and metrics for @csstools/postcss-color-function
Gathering detailed insights and metrics for @csstools/postcss-color-function
npm install @csstools/postcss-color-function
Typescript
Module System
Min. Node Version
Node Version
NPM Version
97.5
Supply Chain
96.7
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
562,845,390
Last Day
244,503
Last Week
4,387,858
Last Month
18,718,178
Last Year
204,408,987
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
4.0.10
Package Id
@csstools/postcss-color-function@4.0.10
Unpacked Size
9.96 kB
Size
3.60 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
-7.3%
244,503
Compared to previous day
Last Week
-9.1%
4,387,858
Compared to previous week
Last Month
2.4%
18,718,178
Compared to previous month
Last Year
6.5%
204,408,987
Compared to previous year
npm install @csstools/postcss-color-function --save-dev
PostCSS Color Function lets you use the color
function in
CSS, following the CSS Color specification.
1.color { 2 color: color(display-p3 0.64331 0.19245 0.16771); 3} 4 5:root { 6 --a-color: color(srgb 0.64331 0.19245 0.16771); 7} 8 9/* becomes */ 10 11.color { 12 color: rgb(179, 35, 35); 13} 14 15:root { 16 --a-color: rgb(164, 49, 43); 17}
Add PostCSS Color Function to your project:
1npm install postcss @csstools/postcss-color-function --save-dev
Use it as a PostCSS plugin:
1const postcss = require('postcss'); 2const postcssColorFunction = require('@csstools/postcss-color-function'); 3 4postcss([ 5 postcssColorFunction(/* pluginOptions */) 6]).process(YOUR_CSS /*, processOptions */);
The preserve
option determines whether the original notation
is preserved. By default, it is not preserved.
1postcssColorFunction({ preserve: true })
1.color { 2 color: color(display-p3 0.64331 0.19245 0.16771); 3} 4 5:root { 6 --a-color: color(srgb 0.64331 0.19245 0.16771); 7} 8 9/* becomes */ 10 11.color { 12 color: rgb(179, 35, 35); 13 color: color(display-p3 0.64331 0.19245 0.16771); 14} 15 16:root { 17 --a-color: rgb(164, 49, 43); 18} 19 20@supports (color: color(display-p3 0 0 0%)) { 21:root { 22 --a-color: color(srgb 0.64331 0.19245 0.16771); 23} 24}
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.
1postcssColorFunction({ enableProgressiveCustomProperties: false })
1.color { 2 color: color(display-p3 0.64331 0.19245 0.16771); 3} 4 5:root { 6 --a-color: color(srgb 0.64331 0.19245 0.16771); 7} 8 9/* becomes */ 10 11.color { 12 color: rgb(179, 35, 35); 13 color: color(display-p3 0.64331 0.19245 0.16771); 14} 15 16:root { 17 --a-color: rgb(164, 49, 43); 18 --a-color: color(srgb 0.64331 0.19245 0.16771); 19}
Custom properties do not fallback to the previous declaration
1.color-spaces { 2 color: color(a98-rgb 0.803 0.484 0.944); 3 color: color(display-p3 0.8434 0.509 0.934); 4 color: color(prophoto-rgb 0.759 0.493 0.898); 5 color: color(rec2020 0.772 0.491 0.920); 6 color: color(srgb 0.897 0.488 0.959); 7 color: color(srgb-linear 0.783 0.203 0.910); 8 color: color(xyz 0.560 0.377 0.904); 9 color: color(xyz-d50 0.550 0.375 0.680); 10 color: color(xyz-d65 0.560 0.377 0.904); 11}
This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/tree/main/css-color-4. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
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@csstools/postcss-color-mix-function
Use the color-mix function in CSS
@csstools/postcss-hwb-function
Use hwb() color functions in CSS
@csstools/postcss-oklab-function
Use oklab() and oklch() color functions in CSS
@csstools/postcss-light-dark-function
Use the light-dark() color function in CSS