postcss-nesting
Advanced tools
Comparing version 9.0.0 to 10.0.0
@@ -5,8 +5,8 @@ { | ||
"license": "CC0-1.0", | ||
"version": "9.0.0", | ||
"version": "10.0.0", | ||
"type": "module", | ||
"main": "postcss-8-nesting/postcss-nesting.cjs", | ||
"module": "postcss-8-nesting/postcss-nesting.mjs", | ||
"jsdelivr": "postcss-8-nesting/postcss-nesting.mjs", | ||
"unpkg": "postcss-8-nesting/postcss-nesting.mjs", | ||
"main": "dist/index.cjs", | ||
"module": "dist/index.mjs", | ||
"jsdelivr": "dist/index.mjs", | ||
"unpkg": "dist/index.mjs", | ||
"publishConfig": { | ||
@@ -21,33 +21,27 @@ "access": "public" | ||
".": { | ||
"import": "./postcss-8-nesting/postcss-nesting.mjs", | ||
"require": "./postcss-8-nesting/postcss-nesting.cjs", | ||
"default": "./postcss-8-nesting/postcss-nesting.mjs" | ||
}, | ||
"./postcss-7-nesting": { | ||
"import": "./postcss-7-nesting/postcss-nesting.mjs", | ||
"require": "./postcss-7-nesting/postcss-nesting.cjs", | ||
"default": "./postcss-7-nesting/postcss-nesting.mjs" | ||
}, | ||
"./postcss-8-nesting": { | ||
"import": "./postcss-8-nesting/postcss-nesting.mjs", | ||
"require": "./postcss-8-nesting/postcss-nesting.cjs", | ||
"default": "./postcss-8-nesting/postcss-nesting.mjs" | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.cjs", | ||
"default": "./dist/index.mjs" | ||
} | ||
}, | ||
"files": [ | ||
"postcss-7-nesting", | ||
"postcss-8-nesting" | ||
"dist" | ||
], | ||
"scripts": { | ||
"prepublishOnly": "npm test", | ||
"build": "node .bin/build.js", | ||
"build": "rollup -c .rollup.js", | ||
"test": "node .bin/test.js", | ||
"test:lint": "node .bin/test-lint.js", | ||
"test:tape": "node .bin/test-tape.js" | ||
"test:tape": "node .bin/test-tape.js", | ||
"test:deno": "deno run --unstable --allow-env --allow-read .bin/test-deno.js" | ||
}, | ||
"devDependencies": { | ||
"esbuild": "0.13.9", | ||
"eslint": "8.1.0", | ||
"eslint-config-dev": "2.0.0", | ||
"nodemon": "2.0.14", | ||
"@babel/core": "^7.15.8", | ||
"@babel/preset-env": "^7.15.8", | ||
"@rollup/plugin-babel": "^5.3.0", | ||
"@rollup/plugin-commonjs": "^21.0.1", | ||
"@rollup/plugin-node-resolve": "^13.0.6", | ||
"eslint": "^8.1.0", | ||
"rollup": "^2.58.3", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"postcss": "8.3.11", | ||
@@ -60,3 +54,3 @@ "pre-commit": "1.2.2" | ||
"engines": { | ||
"node": "12 - 16" | ||
"node": ">= 12" | ||
}, | ||
@@ -123,3 +117,6 @@ "eslintConfig": { | ||
"csswg" | ||
] | ||
], | ||
"dependencies": { | ||
"postcss-selector-parser": "6.0.6" | ||
} | ||
} |
@@ -31,7 +31,2 @@ # PostCSS Nesting [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS" width="90" height="90" align="right">][postcss] | ||
**NOTICE**: In a future version of this project, nesting at-rules like `@media` | ||
may be deprecated, as they are not part of the nesting proposal. In a comment, | ||
a CSSWG member expressed interest in handling nested `@media` while handling | ||
selector nesting. So deprecating nested at-rules has been temporarily delayed. | ||
## Usage | ||
@@ -80,2 +75,61 @@ | ||
## Options | ||
### allowDeclarationsAfterNestedRules | ||
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 | ||
@@ -82,0 +136,0 @@ [cli-url]: https://travis-ci.org/csstools/postcss-nesting |
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
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
1282362
10447
146
2
10
9
2
+ Addedcssesc@3.0.0(transitive)
+ Addedpostcss-selector-parser@6.0.6(transitive)
+ Addedutil-deprecate@1.0.2(transitive)