From efbc2ffe6a1ee5ec38a4396305561d6515d0943e Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Fri, 30 Aug 2024 17:21:18 +0800 Subject: node fixes, updates --- node_modules/postcss-nested/README.md | 53 ++++++++++++++++---------------- node_modules/postcss-nested/index.js | 36 +++++++++++----------- node_modules/postcss-nested/package.json | 18 +++++++---- 3 files changed, 56 insertions(+), 51 deletions(-) (limited to 'node_modules/postcss-nested') diff --git a/node_modules/postcss-nested/README.md b/node_modules/postcss-nested/README.md index 7e78ec88..c65988d7 100644 --- a/node_modules/postcss-nested/README.md +++ b/node_modules/postcss-nested/README.md @@ -8,25 +8,25 @@ ```css .phone { - &_title { - width: 500px; - @media (max-width: 500px) { - width: auto; - } - body.is_dark & { - color: white; - } + &_title { + width: 500px; + @media (max-width: 500px) { + width: auto; } - img { - display: block; + body.is_dark & { + color: white; } + } + img { + display: block; + } } .title { font-size: var(--font); @at-root html { - --font: 16px + --font: 16px; } } ``` @@ -35,39 +35,39 @@ will be processed to: ```css .phone_title { - width: 500px; + width: 500px; } @media (max-width: 500px) { - .phone_title { - width: auto; - } + .phone_title { + width: auto; + } } body.is_dark .phone_title { - color: white; + color: white; } .phone img { - display: block; + display: block; } .title { font-size: var(--font); } html { - --font: 16px + --font: 16px; } ``` Related plugins: -* Use [`postcss-current-selector`] **after** this plugin if you want +- Use [`postcss-current-selector`] **after** this plugin if you want to use current selector in properties or variables values. -* Use [`postcss-nested-ancestors`] **before** this plugin if you want +- Use [`postcss-nested-ancestors`] **before** this plugin if you want to reference any ancestor element directly in your selectors with `^&`. Alternatives: -* See also [`postcss-nesting`], which implements [CSSWG draft]. -* [`postcss-nested-props`] for nested properties like `font-size`. +- See also [`postcss-nesting`], which implements [CSSWG draft]. +- [`postcss-nested-props`] for nested properties like `font-size`. { let bubble = atruleNames( - ['media', 'supports', 'layer', 'container'], + ['media', 'supports', 'layer', 'container', 'starting-style'], opts.bubble ) let atruleChilds = createFnAtruleChilds(bubble) @@ -287,8 +287,6 @@ module.exports = (opts = {}) => { let preserveEmpty = opts.preserveEmpty return { - postcssPlugin: 'postcss-nested', - Once(root) { root.walkAtRules(rootRuleName, node => { normalizeRootRule(node) @@ -296,6 +294,15 @@ module.exports = (opts = {}) => { }) }, + postcssPlugin: 'postcss-nested', + + RootExit(root) { + if (root[hasRootRule]) { + root.walkAtRules(rootRuleName, unwrapRootRule) + root[hasRootRule] = false + } + }, + Rule(rule) { let unwrapped = false let after = rule @@ -348,13 +355,6 @@ module.exports = (opts = {}) => { rule.raws.semicolon = true if (rule.nodes.length === 0) rule.remove() } - }, - - RootExit(root) { - if (root[hasRootRule]) { - root.walkAtRules(rootRuleName, unwrapRootRule) - root[hasRootRule] = false - } } } } diff --git a/node_modules/postcss-nested/package.json b/node_modules/postcss-nested/package.json index 3c9d9ac9..abc8e6c7 100644 --- a/node_modules/postcss-nested/package.json +++ b/node_modules/postcss-nested/package.json @@ -1,6 +1,6 @@ { "name": "postcss-nested", - "version": "6.0.1", + "version": "6.2.0", "description": "PostCSS plugin to unwrap nested rules like how Sass does it", "keywords": [ "postcss", @@ -15,14 +15,20 @@ "engines": { "node": ">=12.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "peerDependencies": { "postcss": "^8.2.14" }, "dependencies": { - "postcss-selector-parser": "^6.0.11" + "postcss-selector-parser": "^6.1.1" } } -- cgit v1.2.3