postcss-nesting
Advanced tools
Comparing version 10.0.0 to 10.0.1
@@ -5,3 +5,3 @@ { | ||
"license": "CC0-1.0", | ||
"version": "10.0.0", | ||
"version": "10.0.1", | ||
"type": "module", | ||
@@ -30,3 +30,3 @@ "main": "dist/index.cjs", | ||
"scripts": { | ||
"prepublishOnly": "npm test", | ||
"prepublishOnly": "npm run build && npm test", | ||
"build": "rollup -c .rollup.js", | ||
@@ -33,0 +33,0 @@ "test": "node .bin/test.js", |
@@ -9,3 +9,4 @@ # PostCSS Nesting [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS" width="90" height="90" align="right">][postcss] | ||
[PostCSS Nesting] lets you nest style rules inside each other, following the | ||
[CSS Nesting] specification. | ||
[CSS Nesting] specification. If you want nested rules the same way [Sass] works | ||
you might want to use [PostCSS Nested] instead. | ||
@@ -75,61 +76,8 @@ ```pcss | ||
## Options | ||
### ⚠️ Spec disclaimer | ||
### allowDeclarationsAfterNestedRules | ||
The [CSS Nesting Module] spec states on nesting that "Declarations occuring after a nested rule are invalid and ignored.". | ||
While we think it makes sense on browsers, enforcing this at the plugin level introduces several constrains that would | ||
interfere with PostCSS' plugin nature such as with `@mixin` | ||
The [specification](https://www.w3.org/TR/css-nesting-1/#mixing) does not allow declarations after nested rules. | ||
This was previously supported by this plugin and can be re-enabled with `allowDeclarationsAfterNestedRules`. | ||
Before : | ||
```css | ||
a { | ||
color: red; | ||
& b { | ||
color: white; | ||
} | ||
padding: 20px; | ||
} | ||
``` | ||
After **without** the option : | ||
```js | ||
postcssNesting() | ||
``` | ||
```css | ||
a { | ||
color: red; | ||
} | ||
a b { | ||
color: white; | ||
} | ||
``` | ||
After **with** the option : | ||
```js | ||
postcssNesting({ | ||
allowDeclarationsAfterNestedRules: true | ||
}) | ||
``` | ||
```css | ||
a { | ||
color: red; | ||
} | ||
a b { | ||
color: white; | ||
} | ||
a { | ||
padding: 20px; | ||
} | ||
``` | ||
[cli-img]: https://img.shields.io/travis/csstools/postcss-nesting.svg | ||
@@ -148,1 +96,4 @@ [cli-url]: https://travis-ci.org/csstools/postcss-nesting | ||
[Deno]: https://deno.land/x/postcss_nesting | ||
[PostCSS Nested]: https://github.com/postcss/postcss-nested | ||
[Sass]: https://sass-lang.com/ | ||
[CSS Nesting Module]: https://www.w3.org/TR/css-nesting-1/ |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
1270735
10336
97