Socket
Socket
Sign inDemoInstall

postcss-nesting

Package Overview
Dependencies
Maintainers
2
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-nesting - npm Package Compare versions

Comparing version 10.0.3 to 10.1.0

5

package.json

@@ -5,3 +5,3 @@ {

"license": "CC0-1.0",
"version": "10.0.3",
"version": "10.1.0",
"author": "Jonathan Neal <jonathantneal@hotmail.com>",

@@ -75,3 +75,6 @@ "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting#readme",

"directory": "plugins/postcss-nesting"
},
"volta": {
"extends": "../../package.json"
}
}

@@ -74,2 +74,103 @@ # PostCSS Nesting [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS" width="90" height="90" align="right">][postcss]

## Options
### noIsPseudoSelector
#### Specificity
Before :
```css
#alpha,
.beta {
&:hover {
order: 1;
}
}
```
After **without** the option :
```js
postcssNesting()
```
```css
:is(#alpha,.beta):hover {
order: 1;
}
```
_`.beta:hover` has specificity as if `.beta` where an id selector, matching the specification._
[specificity: 1, 1, 0](https://polypane.app/css-specificity-calculator/#selector=%3Ais(%23alpha%2C.beta)%3Ahover)
After **with** the option :
```js
postcssNesting({
noIsPseudoSelector: true
})
```
```css
#alpha:hover, .beta:hover {
order: 1;
}
```
_`.beta:hover` has specificity as if `.beta` where a class selector, conflicting with the specification._
[specificity: 0, 2, 0](https://polypane.app/css-specificity-calculator/#selector=.beta%3Ahover)
#### Complex selectors
Before :
```css
.alpha > .beta {
& + & {
order: 2;
}
}
```
After **without** the option :
```js
postcssNesting()
```
```css
:is(.alpha > .beta) + :is(.alpha > .beta) {
order: 2;
}
```
After **with** the option :
```js
postcssNesting({
noIsPseudoSelector: true
})
```
```css
.alpha > .beta + .alpha > .beta {
order: 2;
}
```
_this is a different selector than expected as `.beta + .alpha` matches `.beta` followed by `.alpha`._<br>
_avoid these cases when you disable `:is()`_<br>
_writing the selector without nesting is advised here_
```css
/* without nesting */
.alpha > .beta + .beta {
order: 2;
}
```
### ⚠️ Spec disclaimer

@@ -76,0 +177,0 @@

dist/cli.mjs

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc