Installations
npm install @csstools/postcss-nesting-experimental
Developer Guide
Typescript
Yes
Module System
ESM
Min. Node Version
>=18
Node Version
22.1.0
NPM Version
10.7.0
Score
63.9
Supply Chain
96.9
Quality
80.6
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Languages
CSS (43.39%)
JavaScript (30.21%)
TypeScript (22.76%)
HTML (3.06%)
Nunjucks (0.48%)
Shell (0.1%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
Download Statistics
Total Downloads
3,754
Last Day
1
Last Week
9
Last Month
48
Last Year
1,156
GitHub Statistics
MIT-0 License
933 Stars
4,173 Commits
73 Forks
11 Watchers
4 Branches
131 Contributors
Updated on Feb 12, 2025
Bundle Size
54.93 kB
Minified
13.86 kB
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
3.0.1
Package Id
@csstools/postcss-nesting-experimental@3.0.1
Unpacked Size
17.87 kB
Size
5.80 kB
File Count
6
NPM Version
10.7.0
Node Version
22.1.0
Published on
Oct 23, 2024
Total Downloads
Cumulative downloads
Total Downloads
3,754
Last Day
0%
1
Compared to previous day
Last Week
-47.1%
9
Compared to previous week
Last Month
-21.3%
48
Compared to previous month
Last Year
-31.9%
1,156
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Peer Dependencies
1
PostCSS Nesting Experimental 
PostCSS Nesting Experimental lets you nest style rules inside each other, following the CSS Nesting specification. If you want nested rules the same way Sass works you might want to use PostCSS Nested instead.
[!WARNING] Experimental version of PostCSS Nesting
1a, b { 2 color: red; 3 4 & c, & d { 5 color: white; 6 } 7 8 :is(e) & { 9 color: yellow; 10 } 11} 12 13& { 14 color: pink; 15} 16 17 18/* becomes */ 19 20a, b { 21 color: red; 22} 23 24:is(a,b) c, :is(a,b) d { 25 color: white; 26 } 27 28:is(e) :is(a,b) { 29 color: yellow; 30 } 31 32:scope { 33 color: pink; 34}
Relative selectors :
1.parent { 2 color: red; 3 4 .child { 5 color: white; 6 } 7 8 > .other-child { 9 color: yellow; 10 } 11} 12 13/* becomes */ 14 15.parent { 16 color: red; 17} 18 19:is(.parent) .child { 20 color: white; 21} 22 23:is(.parent)> .other-child { 24 color: yellow; 25}
Usage
Add PostCSS Nesting Experimental to your project:
1npm install @csstools/postcss-nesting-experimental --save-dev
Use PostCSS Nesting Experimental as a PostCSS plugin:
1import postcss from 'postcss'; 2import postcssNestingExperimental from '@csstools/postcss-nesting-experimental'; 3 4postcss([ 5 postcssNestingExperimental(/* pluginOptions */) 6]).process(YOUR_CSS /*, processOptions */);
PostCSS Nesting Experimental runs in all Node environments, with special instructions for:
Node | Webpack | Gulp | Grunt |
---|
⚠️ Spec disclaimer
The CSS Nesting specification states on nesting that "Declarations occurring after a nested rule are invalid and ignored.".
While we think it makes sense on browsers, enforcing this at the plugin level introduces several constraints that would
interfere with PostCSS' plugin nature such as with @mixin

No vulnerabilities found.
Reason
30 commit(s) and 9 issue activity found in the last 90 days -- score normalized to 10
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
no dangerous workflow patterns detected
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
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
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Score
5.9
/10
Last Scanned on 2025-02-10
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