Gathering detailed insights and metrics for postcss-lab-function
Gathering detailed insights and metrics for postcss-lab-function
Gathering detailed insights and metrics for postcss-lab-function
Gathering detailed insights and metrics for postcss-lab-function
npm install postcss-lab-function
Typescript
Module System
Min. Node Version
Node Version
NPM Version
97.7
Supply Chain
97.7
Quality
89.1
Maintenance
100
Vulnerability
100
License
CSS (43.37%)
JavaScript (30.22%)
TypeScript (22.76%)
HTML (3.06%)
Nunjucks (0.48%)
Shell (0.1%)
Total Downloads
1,410,053,329
Last Day
1,017,192
Last Week
4,696,237
Last Month
21,581,102
Last Year
287,950,716
931 Stars
4,164 Commits
73 Forks
11 Watching
3 Branches
131 Contributors
Minified
Minified + Gzipped
Latest Version
7.0.7
Package Id
postcss-lab-function@7.0.7
Unpacked Size
11.12 kB
Size
4.03 kB
File Count
7
NPM Version
10.9.0
Node Version
22.12.0
Publised On
27 Dec 2024
Cumulative downloads
Total Downloads
Last day
-6.7%
1,017,192
Compared to previous day
Last week
-18.4%
4,696,237
Compared to previous week
Last month
5.9%
21,581,102
Compared to previous month
Last year
-13.6%
287,950,716
Compared to previous year
PostCSS Lab Function lets you use lab
and lch
color functions in
CSS, following the CSS Color specification.
1.color-lab { 2 color: lab(40% 56.6 39); 3} 4 5.color-lch { 6 color: lch(40% 68.735435 34.568626); 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.color-lch { 17 color: rgb(179, 35, 35); 18 color: color(display-p3 0.64331 0.19245 0.16771); 19}
Add PostCSS Lab Function to your project:
1npm install postcss postcss-lab-function --save-dev
Use it as a PostCSS plugin:
1const postcss = require('postcss'); 2const postcssLabFunction = require('postcss-lab-function'); 3 4postcss([ 5 postcssLabFunction(/* pluginOptions */) 6]).process(YOUR_CSS /*, processOptions */);
PostCSS Lab Function runs in all Node environments, with special instructions for:
Node | PostCSS CLI | Webpack | Gulp | Grunt |
---|
The preserve
option determines whether the original functional color notation
is preserved. By default, it is not preserved.
1postcssLabFunction({ preserve: true })
1.color { 2 color: lab(40% 56.6 39); 3} 4 5/* becomes */ 6 7.color { 8 color: rgb(179, 35, 35); 9 color: color(display-p3 0.64331 0.19245 0.16771); 10 color: lab(40% 56.6 39); 11}
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.
1postcssLabFunction({ enableProgressiveCustomProperties: false })
1:root { 2 --firebrick: lab(40% 56.6 39); 3} 4 5/* becomes */ 6 7:root { 8 --firebrick: rgb(178, 34, 34); /* will never be used, not even in older browser */ 9 --firebrick: color(display-p3 0.64331 0.19245 0.16771); /* will never be used, not even in older browser */ 10 --firebrick: lab(40% 56.6 39); 11}
The subFeatures.displayP3
option determines if color(display-p3 ...)
is used as a fallback.
By default, it is enabled.
display-p3
can display wider gamut colors than rgb
on some devices.
1postcssOKLabFunction({ 2 subFeatures: { 3 displayP3: false 4 } 5})
1.color { 2 color: lab(40% 56.6 39); 3} 4 5/* becomes */ 6 7.color { 8 color: rgb(179, 35, 35); 9 color: lab(40% 56.6 39); 10}
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 12 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
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 0/21 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-02-03
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