Installations
npm install postcss-color-functional-notation
Developer Guide
Typescript
Yes
Module System
ESM
Min. Node Version
>=18
Node Version
22.12.0
NPM Version
10.9.0
Score
97.6
Supply Chain
96.9
Quality
89.1
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Languages
CSS (43.37%)
JavaScript (30.22%)
TypeScript (22.76%)
HTML (3.06%)
Nunjucks (0.48%)
Shell (0.1%)
Developer
Download Statistics
Total Downloads
1,412,259,424
Last Day
1,024,187
Last Week
4,729,150
Last Month
21,733,479
Last Year
289,944,459
GitHub Statistics
931 Stars
4,164 Commits
73 Forks
11 Watching
3 Branches
131 Contributors
Bundle Size
168.60 kB
Minified
36.16 kB
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
7.0.7
Package Id
postcss-color-functional-notation@7.0.7
Unpacked Size
9.70 kB
Size
3.41 kB
File Count
7
NPM Version
10.9.0
Node Version
22.12.0
Publised On
27 Dec 2024
Total Downloads
Cumulative downloads
Total Downloads
1,412,259,424
Last day
-6.7%
1,024,187
Compared to previous day
Last week
-18.4%
4,729,150
Compared to previous week
Last month
5.9%
21,733,479
Compared to previous month
Last year
-13.2%
289,944,459
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
PostCSS Color Functional Notation
npm install postcss-color-functional-notation --save-dev
PostCSS Color Functional Notation lets you use space and slash separated color notation in CSS, following the CSS Color specification.
1:root { 2 --firebrick: rgb(178 34 34); 3 --firebrick-a50: rgb(70% 13.5% 13.5% / 50%); 4 --firebrick-hsl: hsla(0 68% 42%); 5 --firebrick-hsl-a50: hsl(0 68% 42% / 50%); 6} 7 8/* becomes */ 9 10:root { 11 --firebrick: rgb(178, 34, 34); 12 --firebrick-a50: rgba(179, 34, 34, 0.5); 13 --firebrick-hsl: hsl(0, 68%, 42%); 14 --firebrick-hsl-a50: hsla(0, 68%, 42%, 0.5); 15}
Usage
Add PostCSS Color Functional Notation to your project:
1npm install postcss postcss-color-functional-notation --save-dev
Use it as a PostCSS plugin:
1const postcss = require('postcss'); 2const postcssColorFunctionalNotation = require('postcss-color-functional-notation'); 3 4postcss([ 5 postcssColorFunctionalNotation(/* pluginOptions */) 6]).process(YOUR_CSS /*, processOptions */);
Options
preserve
The preserve
option determines whether the original notation
is preserved. By default, it is not preserved.
1postcssColorFunctionalNotation({ preserve: true })
1:root { 2 --firebrick: rgb(178 34 34); 3 --firebrick-a50: rgb(70% 13.5% 13.5% / 50%); 4 --firebrick-hsl: hsla(0 68% 42%); 5 --firebrick-hsl-a50: hsl(0 68% 42% / 50%); 6} 7 8/* becomes */ 9 10:root { 11 --firebrick: rgb(178, 34, 34); 12 --firebrick-a50: rgba(179, 34, 34, 0.5); 13 --firebrick-hsl: hsl(0, 68%, 42%); 14 --firebrick-hsl: hsla(0 68% 42%); 15 --firebrick-hsl-a50: hsla(0, 68%, 42%, 0.5); 16} 17 18@supports (color: rgb(0 0 0 / 0)) { 19:root { 20 --firebrick: rgb(178 34 34); 21 --firebrick-a50: rgb(70% 13.5% 13.5% / 50%); 22} 23} 24 25@supports (color: hsl(0 0% 0% / 0)) { 26:root { 27 --firebrick-hsl-a50: hsl(0 68% 42% / 50%); 28} 29}
enableProgressiveCustomProperties
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.
1postcssColorFunctionalNotation({ enableProgressiveCustomProperties: false })
1:root { 2 --firebrick: rgb(178 34 34); 3 --firebrick-a50: rgb(70% 13.5% 13.5% / 50%); 4 --firebrick-hsl: hsla(0 68% 42%); 5 --firebrick-hsl-a50: hsl(0 68% 42% / 50%); 6} 7 8/* becomes */ 9 10:root { 11 --firebrick: rgb(178, 34, 34); 12 --firebrick: rgb(178 34 34); 13 --firebrick-a50: rgba(179, 34, 34, 0.5); 14 --firebrick-a50: rgb(70% 13.5% 13.5% / 50%); 15 --firebrick-hsl: hsl(0, 68%, 42%); 16 --firebrick-hsl: hsla(0 68% 42%); 17 --firebrick-hsl-a50: hsla(0, 68%, 42%, 0.5); 18 --firebrick-hsl-a50: hsl(0 68% 42% / 50%); 19}
Custom properties do not fallback to the previous declaration
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
- Info: security policy file detected: SECURITY.md:1
- Info: Found linked content: SECURITY.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1
- Info: Found text in security policy: SECURITY.md:1
Reason
license file detected
Details
- Info: project has a license file: LICENSE.md:0
- Info: FSF or OSI recognized license: MIT No Attribution: LICENSE.md:0
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
SAST tool detected but not run on all commits
Details
- Info: SAST configuration detected: CodeQL
- Warn: 0 commits out of 9 are checked with a SAST tool
Reason
branch protection is not maximal on development and all release branches
Details
- Info: 'allow deletion' disabled on branch 'main'
- Info: 'force pushes' disabled on branch 'main'
- Info: 'branch protection settings apply to administrators' is required to merge on branch 'main'
- Warn: could not determine whether codeowners review is allowed
- Warn: no status checks found to merge onto branch 'main'
- Warn: PRs are not required to make changes on branch 'main'; or we don't have data to detect it.If you think it might be the latter, make sure to run Scorecard with a PAT or use Repo Rules (that are always public) instead of Branch Protection settings
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/csstools/postcss-plugins/codeql.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/csstools/postcss-plugins/codeql.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/csstools/postcss-plugins/codeql.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/csstools/postcss-plugins/codeql.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy-preset-env.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/csstools/postcss-plugins/deploy-preset-env.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy-preset-env.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/csstools/postcss-plugins/deploy-preset-env.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/labeler.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/csstools/postcss-plugins/labeler.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/csstools/postcss-plugins/lint.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/csstools/postcss-plugins/lint.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/csstools/postcss-plugins/test.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/csstools/postcss-plugins/test.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/test.yml:98
- Info: 0 out of 11 GitHub-owned GitHubAction dependencies pinned
- Info: 6 out of 7 npmCommand dependencies pinned
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
- Warn: no topLevel permission defined: .github/workflows/codeql.yml:1
- Warn: no topLevel permission defined: .github/workflows/deploy-preset-env.yml:1
- Warn: no topLevel permission defined: .github/workflows/labeler.yml:1
- Warn: no topLevel permission defined: .github/workflows/lint.yml:1
- Warn: no topLevel permission defined: .github/workflows/test.yml:1
- Info: no jobLevel write permissions found
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Score
5.9
/10
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