diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2023-10-14 15:05:55 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2023-10-14 15:05:55 +0800 |
| commit | c06f7ee0a40255214c477e13d9b956a7e07c2900 (patch) | |
| tree | f5982a568ef8fab865d0142e71c7494fea3e4c1b /node_modules/@csstools/postcss-cascade-layers | |
| parent | 3fd9400d4dccc25aa29b5702216732e0b7542073 (diff) | |
postcss,(plugins): nanocss, postcss-preset-env
Diffstat (limited to 'node_modules/@csstools/postcss-cascade-layers')
21 files changed, 482 insertions, 0 deletions
diff --git a/node_modules/@csstools/postcss-cascade-layers/CHANGELOG.md b/node_modules/@csstools/postcss-cascade-layers/CHANGELOG.md new file mode 100644 index 00000000..ebe49f70 --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/CHANGELOG.md @@ -0,0 +1,87 @@ +# Changes to PostCSS Cascade Layers + +### 4.0.0 + +_July 3, 2023_ + +- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) +- Updated [`@csstools/selector-specificity`](/packages/selector-specificity) to [`3.0.0`](/packages/selector-specificity/CHANGELOG.md#300) (major) + +### 3.0.1 + +_January 28, 2023_ + +- Improve `types` declaration in `package.json` + +### 3.0.0 + +_January 24, 2023_ + +- Run `postcss-cascade-layers` late compared to other PostCSS plugins (breaking) + +_This will be the last time we change this after several times back and forth. +We are sticking with this configuration now._ + +### 2.0.0 + +_November 14, 2022_ + +- Run `postcss-cascade-layers` early compared to other PostCSS plugins (breaking) +- Updated: Support for Node v14+ (major). +- Fix: Do not throw when a selector is invalid, show a warning instead. + +### 1.1.1 + +_September 17, 2022_ + +- Fix pre-defined layer order in nested `@layer` rules. + +### 1.1.0 + +_September 14, 2022_ + +- Add support for `@scope` and `@container` as parent rules for `@layer` + +### 1.0.6 + +_September 7, 2022_ + +- Fix broken `@keyframes` in `@layer`. + +### 1.0.5 + +_July 8, 2022_ + +- Fix case insensitive `@layer` matching (`@LaYeR`). +- Updated `@csstools/selector-specificity` to `2.0.2` (patch) + +### 1.0.4 + +_June 23, 2022_ + +- Fix selector order with any pseudo element. This plugin will no longer re-order selectors. + +### 1.0.3 + +_June 4, 2022_ + +- Update `@csstools/selector-specificity` (major) + +### 1.0.2 + +_May 20, 2022_ + +- Use only simple `:not(#\#)` selectors to adjust specificity. + +### 1.0.1 + +_May 17, 2022_ + +- Process CSS after most other plugins to ensure correct analysis and transformation of sugary CSS. +- Fix selector order with `:before` and other pseudo elements. + +### 1.0.0 + +_May 12, 2022_ + +- Initial version diff --git a/node_modules/@csstools/postcss-cascade-layers/LICENSE.md b/node_modules/@csstools/postcss-cascade-layers/LICENSE.md new file mode 100644 index 00000000..e8ae93b9 --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/LICENSE.md @@ -0,0 +1,18 @@ +MIT No Attribution (MIT-0) + +Copyright © CSSTools Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@csstools/postcss-cascade-layers/README.md b/node_modules/@csstools/postcss-cascade-layers/README.md new file mode 100644 index 00000000..0bbceb7c --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/README.md @@ -0,0 +1,202 @@ +# PostCSS Cascade Layers [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][PostCSS] + +[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-cascade-layers.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/cascade-layers.svg" height="20">][css-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord] + +[PostCSS Cascade Layers] lets you use `@layer` following the [Cascade Layers Specification]. For more information on layers, checkout [A Complete Guide to CSS Cascade Layers] by Miriam Suzanne. + +```pcss + +target { + color: purple; +} + +@layer { + target { + color: green; + } +} + + +/* becomes */ + + +target:not(#\#) { + color: purple; +} + +target { + color: green; + } + +``` + +## How it works + +[PostCSS Cascade Layers] creates "layers" of specificity. + +It applies extra specificity on all your styles based on : +- the most specific selector found +- the order in which layers are defined + +```css +@layer A, B; + +@layer B { + .a-less-specific-selector { + /* styles */ + } +} + +@layer A { + #something #very-specific { + /* styles */ + } +} + +@layer C { + .a-less-specific-selector { + /* styles */ + } +} +``` + +most specific selector : +- `#something #very-specific` +- `[2, 0, 0]` +- `2 + 1` -> `3` to ensure there is no overlap + +the order in which layers are defined : +- `A` +- `B` +- `C` + +| layer | previous adjustment | specificity adjustment | selector | +| ------ | ------ | ----------- | --- | +| `A` | `0` | `0 + 0 = 0` | N/A | +| `B` | `0` | `0 + 3 = 3` | `:not(#\#):not(#\#):not(#\#)` | +| `C` | `3` | `3 + 3 = 6` | `:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)` | + +This approach lets more important (later) layers always override less important (earlier) layers.<br> +And layers have enough room internally so that each selector works and overrides as expected. + +More layers with more specificity will cause longer `:not(...)` selectors to be generated. + +⚠️ For this to work the plugin needs to analyze your entire stylesheet at once.<br> +If you have different assets that are unaware of each other it will not work correctly as the analysis will be incorrect. + +## Usage + +Add [PostCSS Cascade Layers] to your project: + +```bash +npm install postcss @csstools/postcss-cascade-layers --save-dev +``` + +Use it as a [PostCSS] plugin: + +```js +const postcss = require('postcss'); +const postcssCascadeLayers = require('@csstools/postcss-cascade-layers'); + +postcss([ + postcssCascadeLayers(/* pluginOptions */) +]).process(YOUR_CSS /*, processOptions */); +``` + +[PostCSS Cascade Layers] runs in all Node environments, with special +instructions for: + +- [Node](INSTALL.md#node) +- [PostCSS CLI](INSTALL.md#postcss-cli) +- [PostCSS Load Config](INSTALL.md#postcss-load-config) +- [Webpack](INSTALL.md#webpack) +- [Next.js](INSTALL.md#nextjs) +- [Gulp](INSTALL.md#gulp) +- [Grunt](INSTALL.md#grunt) + +## Options + +### onRevertLayerKeyword + +The `onRevertLayerKeyword` option enables warnings if `revert-layer` is used. +Transforming `revert-layer` for older browsers is not possible in this plugin. + +Defaults to `warn` + +```js +postcssCascadeLayers({ onRevertLayerKeyword: 'warn' }) // 'warn' | false +``` + +```pcss +/* [postcss-cascade-layers]: handling "revert-layer" is unsupported by this plugin and will cause style differences between browser versions. */ +@layer { + .foo { + color: revert-layer; + } +} +``` + +### onConditionalRulesChangingLayerOrder + +The `onConditionalRulesChangingLayerOrder` option enables warnings if layers are declared in multiple different orders in conditional rules. +Transforming these layers correctly for older browsers is not possible in this plugin. + +Defaults to `warn` + +```js +postcssCascadeLayers({ onConditionalRulesChangingLayerOrder: 'warn' }) // 'warn' | false +``` + +```pcss +/* [postcss-cascade-layers]: handling different layer orders in conditional rules is unsupported by this plugin and will cause style differences between browser versions. */ +@media (min-width: 10px) { + @layer B { + .foo { + color: red; + } + } +} + +@layer A { + .foo { + color: pink; + } +} + +@layer B { + .foo { + color: red; + } +} +``` + +### onImportLayerRule + +The `@import` at-rule can also be used with cascade layers, specifically to create a new layer like so: +```css +@import 'theme.css' layer(utilities); +``` +If your CSS uses `@import` with layers, you will also need the [postcss-import] plugin. This plugin alone will not handle the `@import` at-rule. + +This plugin will warn you when it detects that [postcss-import] did not transform`@import` at-rules. + +```js +postcssCascadeLayers({ onImportLayerRule: 'warn' }) // 'warn' | false +``` + +### Contributors +The contributors to this plugin were [Olu Niyi-Awosusi] and [Sana Javed] from [Oddbird] and Romain Menke. + +[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test +[css-url]: https://cssdb.org/#cascade-layers +[discord]: https://discord.gg/bUadyRwkJS +[npm-url]: https://www.npmjs.com/package/@csstools/postcss-cascade-layers + +[PostCSS]: https://github.com/postcss/postcss +[PostCSS Cascade Layers]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-cascade-layers +[Cascade Layers Specification]: https://www.w3.org/TR/css-cascade-5/#layering +[A Complete Guide to CSS Cascade Layers]: https://css-tricks.com/css-cascade-layers/ +[Olu Niyi-Awosusi]: https://github.com/oluoluoxenfree +[Sana Javed]: https://github.com/sanajaved7 +[Oddbird]: https://github.com/oddbird +[postcss-import]: https://github.com/postcss/postcss-import diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/adjust-selector-specificity.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/adjust-selector-specificity.d.ts new file mode 100644 index 00000000..af7b5e19 --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/dist/adjust-selector-specificity.d.ts @@ -0,0 +1 @@ +export declare function adjustSelectorSpecificity(selector: string, amount: number): string; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/clean-blocks.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/clean-blocks.d.ts new file mode 100644 index 00000000..b9f2a564 --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/dist/clean-blocks.d.ts @@ -0,0 +1,3 @@ +import type { Container } from 'postcss'; +export declare function removeEmptyDescendantBlocks(block: Container | undefined): void; +export declare function removeEmptyAncestorBlocks(block: Container | undefined): void; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/constants.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/constants.d.ts new file mode 100644 index 00000000..6a4c9c36 --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/dist/constants.d.ts @@ -0,0 +1,8 @@ +/** @constant {string} INVALID_LAYER_NAME Used to replace "layer" temporarily when an invalid layer is detected. This allows us to ignore this rule in further processing. */ +export declare const INVALID_LAYER_NAME = "csstools-invalid-layer"; +/** @constant {string} WITH_SELECTORS_LAYER_NAME Used to replace "layer" temporarily for any layer at rules that contain selectors. This allows us to sort these differently from other layer at rules. */ +export declare const WITH_SELECTORS_LAYER_NAME = "csstools-layer-with-selector-rules"; +export declare const ANONYMOUS_LAYER_SUFFIX = "6efdb677-bb05-44e5-840f-29d2175862fd"; +export declare const IMPLICIT_LAYER_SUFFIX = "b147acf6-11a6-4338-a4d0-80aef4cd1a2f"; +export declare const CONDITIONAL_ATRULES: string[]; +export declare const ATRULES_WITH_NON_SELECTOR_BLOCK_LISTS: string[]; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/desugar-and-parse-layer-names.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/desugar-and-parse-layer-names.d.ts new file mode 100644 index 00000000..d44fd454 --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/dist/desugar-and-parse-layer-names.d.ts @@ -0,0 +1,3 @@ +import type { Container } from 'postcss'; +import type { Model } from './model'; +export declare function desugarAndParseLayerNames(root: Container, model: Model): void; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/desugar-nested-layers.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/desugar-nested-layers.d.ts new file mode 100644 index 00000000..e15d3bfb --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/dist/desugar-nested-layers.d.ts @@ -0,0 +1,3 @@ +import type { Container, ChildNode } from 'postcss'; +import type { Model } from './model'; +export declare function desugarNestedLayers(root: Container<ChildNode>, model: Model): void; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/get-conditional-atrule-ancestor.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/get-conditional-atrule-ancestor.d.ts new file mode 100644 index 00000000..25a6756a --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/dist/get-conditional-atrule-ancestor.d.ts @@ -0,0 +1,2 @@ +import type { AtRule } from 'postcss'; +export declare function getConditionalAtRuleAncestor(layerRule: AtRule): AtRule | null; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/get-layer-atrule-ancestor.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/get-layer-atrule-ancestor.d.ts new file mode 100644 index 00000000..b59be340 --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/dist/get-layer-atrule-ancestor.d.ts @@ -0,0 +1,2 @@ +import type { AtRule, Node } from 'postcss'; +export declare function getLayerAtRuleAncestor(node: Node): AtRule | null; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/index.cjs b/node_modules/@csstools/postcss-cascade-layers/dist/index.cjs new file mode 100644 index 00000000..6788e74a --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/dist/index.cjs @@ -0,0 +1 @@ +"use strict";var e=require("postcss-selector-parser"),r=require("@csstools/selector-specificity");const t="csstools-invalid-layer",a="csstools-layer-with-selector-rules",s="6efdb677-bb05-44e5-840f-29d2175862fd",n="b147acf6-11a6-4338-a4d0-80aef4cd1a2f",o=["media","supports"],l=["keyframes"],i=new Set(["layer","supports","media","container","scope"]);function isProcessableLayerRule(e){if("atrule"!==e.type)return!1;if("layer"!==e.name.toLowerCase())return!1;let r=e.parent;for(;r;){if("rule"===r.type)return!1;if("atrule"===r.type&&!i.has(r.name.toLowerCase()))return!1;r=r.parent}return!0}class Model{anonymousLayerCount=0;layerCount=0;layerOrder;layerParamsParsed;layerNameParts;constructor(){this.anonymousLayerCount=0,this.layerCount=0,this.layerOrder=new Map,this.layerParamsParsed=new Map,this.layerNameParts=new Map}createAnonymousLayerName(){const e=`anonymous-${this.anonymousLayerCount}-${s}`;return this.addLayerNameParts(e),this.layerParamsParsed.set(e,[e]),this.anonymousLayerCount++,e}createImplicitLayerName(e){const r=this.layerNameParts.get(e)??[],t=`implicit-${r[r.length-1]}-${n}`;return this.addLayerNameParts([...r,t]),this.layerParamsParsed.set(t,[t]),t}addLayerParams(e,r){r?"string"!=typeof r?this.layerParamsParsed.set(e,r):this.layerParamsParsed.set(e,[r]):this.layerParamsParsed.set(e,[e])}addLayerNameParts(e){"string"!=typeof e?this.layerNameParts.set(e.join("."),e):this.layerNameParts.set(e,[e])}getLayerParams(e){const r=[...this.layerParamsParsed.get(e.params)??[]];let t=e.parent;for(;t;)"atrule"===t.type?(isProcessableLayerRule(t)&&r.push(...this.layerParamsParsed.get(t.params)??[]),t=t.parent):t=t.parent;return r.reverse(),r.flatMap((e=>this.layerNameParts.get(e)??[]))}getLayerNameList(e){const r=this.layerNameParts.get(e)??[],t=[];for(let e=0;e<r.length;e++){const a=r.slice(0,e+1).join(".");this.layerParamsParsed.has(a)||this.layerParamsParsed.set(a,[a]),this.layerNameParts.has(a)||this.layerNameParts.set(a,r.slice(0,e+1)),t.push(r.slice(0,e+1).join("."))}return t}sortLayerNames(){for(const[e,r]of this.layerOrder){const t=this.layerNameParts.get(e)??[];for(let e=1;e<t.length;e++){const a=t.slice(0,e).join(".");this.layerOrder.has(a)||this.layerOrder.set(a,r)}}let e=Array.from(this.layerOrder.entries());e=e.sort(((e,r)=>{const t=this.layerNameParts.get(e[0])??[],a=this.layerNameParts.get(r[0])??[];if(t[0]!==a[0])return(this.layerOrder.get(t[0])??0)-(this.layerOrder.get(a[0])??0);const s=Math.max(t.length,a.length);for(let e=0;e<s;e++){const r=t[e],s=a[e];if(r!==s)return r?s?(this.layerOrder.get(t.slice(0,e).join("."))??0)-(this.layerOrder.get(a.slice(0,e).join("."))??0):-1:1}return 0})),this.layerOrder.clear(),e.forEach(((e,r)=>{this.layerOrder.set(e[0],r)}))}}function adjustSelectorSpecificity(r,t){const a=e().astSync(r),s=e().astSync(generateNot(t));let n=!1;for(let r=0;r<a.nodes[0].nodes.length;r++)if("combinator"===a.nodes[0].nodes[r].type||e.isPseudoElement(a.nodes[0].nodes[r])){a.nodes[0].insertBefore(a.nodes[0].nodes[r],s),n=!0;break}return n||a.nodes[0].insertAfter(a.nodes[0].nodes[a.nodes[0].nodes.length-1],s),a.toString()}function generateNot(e){if(0===e)return"";let r="";for(let t=0;t<e;t++)r+=":not(#\\#)";return r}function someInTree(e,r){let t=!1;return e.walk((e=>{if(r(e))return t=!0,!1})),t}function someAtRuleInTree(e,r){let t=!1;return e.walkAtRules((e=>{if(r(e))return t=!0,!1})),t}function getLayerAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(isProcessableLayerRule(r))return r;r=r.parent}else r=r.parent;return null}function removeEmptyDescendantBlocks(e){var r;e&&(e.walk((e=>{var r;("rule"===e.type||"atrule"===e.type&&["layer",...o].includes(e.name.toLowerCase()))&&(0===(null==(r=e.nodes)?void 0:r.length)&&e.remove())})),0===(null==(r=e.nodes)?void 0:r.length)&&e.remove())}function removeEmptyAncestorBlocks(e){if(!e)return;let r=e;for(;r;){if(void 0===r.nodes)return;if(r.nodes.length>0)return;const e=r.parent;r.remove(),r=e}}function desugarAndParseLayerNames(r,a){r.walkAtRules((r=>{if(!isProcessableLayerRule(r))return;if(r.params){const s=[];let n=!1;if(e().astSync(r.params).each((e=>{const r=[];e.walk((e=>{switch(e.type){case"class":case"tag":r.push(e.value);break;default:n=!0}})),n||(s.push(r.join(".")),a.addLayerNameParts(r))})),a.addLayerParams(r.params,s),r.nodes&&s.length>1&&(n=!0),n)return void(r.name=t);if(!r.nodes||0===r.nodes.length){if(s.length<=1)return;return s.slice(0,-1).forEach((e=>{a.addLayerParams(e,e),r.cloneBefore({params:e})})),a.addLayerParams(s[s.length-1],s[s.length-1]),void(r.params=s[s.length-1])}}r.params||(r.raws.afterName=" ",r.params=a.createAnonymousLayerName());const s=someAtRuleInTree(r,(e=>isProcessableLayerRule(e))),n=someInTree(r,(e=>{if("rule"!==e.type)return!1;return getLayerAtRuleAncestor(e)===r}));if(s&&n){const e=a.createImplicitLayerName(r.params),t=r.clone({params:e});t.walkAtRules((e=>{isProcessableLayerRule(e)&&e.remove()})),r.walk((e=>{if("atrule"===e.type&&isProcessableLayerRule(e))return;if("atrule"===e.type&&o.includes(e.name.toLowerCase()))return;getLayerAtRuleAncestor(e)===r&&e.remove()})),r.append(t),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)}}))}function desugarNestedLayers(e,r){for(;someAtRuleInTree(e,(e=>e.nodes&&someAtRuleInTree(e,(e=>isProcessableLayerRule(e)))));){let t=!1;if(e.walkAtRules((a=>{var s,n;if(isProcessableLayerRule(a)&&a.parent!==e){if("atrule"===(null==(s=a.parent)?void 0:s.type)&&isProcessableLayerRule(a.parent)){const e=a.parent;{const t=r.layerNameParts.get(e.params),s=r.layerNameParts.get(a.params);if(!t||!s)return;r.layerNameParts.set(`${e.params}.${a.params}`,[...t,...s]),r.layerParamsParsed.set(`${e.params}.${a.params}`,[`${e.params}.${a.params}`])}return a.params=`${e.params}.${a.params}`,e.before(a),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}if("atrule"===(null==(n=a.parent)?void 0:n.type)){const e=a.parent,r=e.clone(),t=a.clone();return r.removeAll(),t.removeAll(),r.append(a.nodes),t.append(r),e.before(t),a.remove(),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}t=!0}})),t)break}}function sortRootNodes(e,r){e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const r=e.clone(),t=e.clone();r.walkAtRules((e=>{if(l.includes(e.name.toLowerCase())){const r=e.parent;return e.remove(),removeEmptyDescendantBlocks(r),void removeEmptyAncestorBlocks(r)}if(someInTree(e,(e=>"rule"===e.type)))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkAtRules((e=>{if(o.includes(e.name.toLowerCase()))return removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)})),r.name=a,e.replaceWith(r,t),0===r.nodes.length&&r.remove(),0===t.nodes.length&&t.remove()})),e.nodes.sort(((e,t)=>{const a="atrule"===e.type&&"layer"===e.name.toLowerCase(),s="atrule"===t.type&&"layer"===t.name.toLowerCase();if(a&&s){return(r.layerOrder.get(e.params)??0)-(r.layerOrder.get(t.params)??0)}return a!==s?a?-1:1:0})),e.walkAtRules(a,(e=>{e.name="layer"}))}function getConditionalAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(o.includes(r.name.toLowerCase()))return r;r=r.parent}else r=r.parent;return null}function recordLayerOrder(e,r,{result:t,options:a}){e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const o=r.getLayerParams(e),l=o.join(".");r.layerOrder.has(l)||(a.onConditionalRulesChangingLayerOrder&&getConditionalAtRuleAncestor(e)&&!e.params.endsWith(n)&&!e.params.endsWith(s)&&e.warn(t,"handling different layer orders in conditional rules is unsupported by this plugin and will cause style differences between browser versions."),r.layerParamsParsed.has(l)||r.layerParamsParsed.set(l,[l]),r.layerNameParts.has(l)||r.layerNameParts.set(l,[...o]),r.getLayerNameList(l).forEach((e=>{r.layerOrder.has(e)||(r.layerOrder.set(e,r.layerCount),r.layerCount+=1)}))),e.nodes&&0!==e.nodes.length||e.remove()}))}function splitImportantStyles(e){e.walkDecls((e=>{var r;if(!e.important)return;const t=e.parent;if(!t)return;if("atrule"===(null==t||null==(r=t.parent)?void 0:r.type)&&l.includes(t.parent.name.toLowerCase()))return;const a=t.clone();a.each((e=>{"decl"===e.type&&e.important||e.remove()})),t.each((e=>{"decl"===e.type&&e.important&&e.remove()})),t.before(a),removeEmptyDescendantBlocks(t)}))}const creator=a=>{const s=Object.assign({onRevertLayerKeyword:"warn",onConditionalRulesChangingLayerOrder:"warn",onImportLayerRule:"warn"},a);return{postcssPlugin:"postcss-cascade-layers",OnceExit(a,{result:n}){s.onRevertLayerKeyword&&a.walkDecls((e=>{"revert-layer"===e.value.toLowerCase()&&e.warn(n,'handling "revert-layer" is unsupported by this plugin and will cause style differences between browser versions.')})),s.onImportLayerRule&&a.walkAtRules((e=>{"import"===e.name.toLowerCase()&&e.params.toLowerCase().includes("layer")&&e.warn(n,"To use @import with layers, the postcss-import plugin is also required. This plugin alone will not support using the @import at-rule.")})),splitImportantStyles(a);const o=new Model;if(desugarAndParseLayerNames(a,o),recordLayerOrder(a,o,{result:n,options:s}),!o.layerCount)return void a.walkAtRules(t,(e=>{e.name="layer"}));let i=0;for(a.walkRules((t=>{t.selectors.forEach((a=>{try{const t=r.selectorSpecificity(e().astSync(a));i=Math.max(i,t.a+1)}catch(e){t.warn(n,`Failed to parse selector : "${a}" with message: "${e.message}"`)}}))})),a.walkRules((e=>{e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase())||getLayerAtRuleAncestor(e)||e.some((e=>"decl"===e.type&&e.important))||(e.selectors=e.selectors.map((r=>{try{return adjustSelectorSpecificity(r,o.layerCount*i)}catch(t){e.warn(n,`Failed to parse selector : "${r}" with message: "${t.message}"`)}return r})))})),o.sortLayerNames(),desugarNestedLayers(a,o),sortRootNodes(a,o),a.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=getLayerAtRuleAncestor(e);if(!r)return;const t=o.getLayerParams(r).join(".");let a=(o.layerOrder.get(t)??0)*i;e.some((e=>"decl"===e.type&&e.important))&&(a=o.layerCount-a),e.selectors=e.selectors.map((e=>adjustSelectorSpecificity(e,a)))}));someAtRuleInTree(a,(e=>isProcessableLayerRule(e)));)a.walkAtRules((e=>{isProcessableLayerRule(e)&&e.replaceWith(e.nodes)}));a.walkAtRules(t,(e=>{e.name="layer"}))}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/index.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/index.d.ts new file mode 100644 index 00000000..9f366fbb --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/dist/index.d.ts @@ -0,0 +1,5 @@ +import type { PluginCreator } from 'postcss'; +import type { pluginOptions } from './options'; +export type { pluginOptions } from './options'; +declare const creator: PluginCreator<pluginOptions>; +export default creator; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/index.mjs b/node_modules/@csstools/postcss-cascade-layers/dist/index.mjs new file mode 100644 index 00000000..5894e725 --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/dist/index.mjs @@ -0,0 +1 @@ +import e from"postcss-selector-parser";import{selectorSpecificity as r}from"@csstools/selector-specificity";const t="csstools-invalid-layer",a="csstools-layer-with-selector-rules",s="6efdb677-bb05-44e5-840f-29d2175862fd",n="b147acf6-11a6-4338-a4d0-80aef4cd1a2f",o=["media","supports"],l=["keyframes"],i=new Set(["layer","supports","media","container","scope"]);function isProcessableLayerRule(e){if("atrule"!==e.type)return!1;if("layer"!==e.name.toLowerCase())return!1;let r=e.parent;for(;r;){if("rule"===r.type)return!1;if("atrule"===r.type&&!i.has(r.name.toLowerCase()))return!1;r=r.parent}return!0}class Model{anonymousLayerCount=0;layerCount=0;layerOrder;layerParamsParsed;layerNameParts;constructor(){this.anonymousLayerCount=0,this.layerCount=0,this.layerOrder=new Map,this.layerParamsParsed=new Map,this.layerNameParts=new Map}createAnonymousLayerName(){const e=`anonymous-${this.anonymousLayerCount}-${s}`;return this.addLayerNameParts(e),this.layerParamsParsed.set(e,[e]),this.anonymousLayerCount++,e}createImplicitLayerName(e){const r=this.layerNameParts.get(e)??[],t=`implicit-${r[r.length-1]}-${n}`;return this.addLayerNameParts([...r,t]),this.layerParamsParsed.set(t,[t]),t}addLayerParams(e,r){r?"string"!=typeof r?this.layerParamsParsed.set(e,r):this.layerParamsParsed.set(e,[r]):this.layerParamsParsed.set(e,[e])}addLayerNameParts(e){"string"!=typeof e?this.layerNameParts.set(e.join("."),e):this.layerNameParts.set(e,[e])}getLayerParams(e){const r=[...this.layerParamsParsed.get(e.params)??[]];let t=e.parent;for(;t;)"atrule"===t.type?(isProcessableLayerRule(t)&&r.push(...this.layerParamsParsed.get(t.params)??[]),t=t.parent):t=t.parent;return r.reverse(),r.flatMap((e=>this.layerNameParts.get(e)??[]))}getLayerNameList(e){const r=this.layerNameParts.get(e)??[],t=[];for(let e=0;e<r.length;e++){const a=r.slice(0,e+1).join(".");this.layerParamsParsed.has(a)||this.layerParamsParsed.set(a,[a]),this.layerNameParts.has(a)||this.layerNameParts.set(a,r.slice(0,e+1)),t.push(r.slice(0,e+1).join("."))}return t}sortLayerNames(){for(const[e,r]of this.layerOrder){const t=this.layerNameParts.get(e)??[];for(let e=1;e<t.length;e++){const a=t.slice(0,e).join(".");this.layerOrder.has(a)||this.layerOrder.set(a,r)}}let e=Array.from(this.layerOrder.entries());e=e.sort(((e,r)=>{const t=this.layerNameParts.get(e[0])??[],a=this.layerNameParts.get(r[0])??[];if(t[0]!==a[0])return(this.layerOrder.get(t[0])??0)-(this.layerOrder.get(a[0])??0);const s=Math.max(t.length,a.length);for(let e=0;e<s;e++){const r=t[e],s=a[e];if(r!==s)return r?s?(this.layerOrder.get(t.slice(0,e).join("."))??0)-(this.layerOrder.get(a.slice(0,e).join("."))??0):-1:1}return 0})),this.layerOrder.clear(),e.forEach(((e,r)=>{this.layerOrder.set(e[0],r)}))}}function adjustSelectorSpecificity(r,t){const a=e().astSync(r),s=e().astSync(generateNot(t));let n=!1;for(let r=0;r<a.nodes[0].nodes.length;r++)if("combinator"===a.nodes[0].nodes[r].type||e.isPseudoElement(a.nodes[0].nodes[r])){a.nodes[0].insertBefore(a.nodes[0].nodes[r],s),n=!0;break}return n||a.nodes[0].insertAfter(a.nodes[0].nodes[a.nodes[0].nodes.length-1],s),a.toString()}function generateNot(e){if(0===e)return"";let r="";for(let t=0;t<e;t++)r+=":not(#\\#)";return r}function someInTree(e,r){let t=!1;return e.walk((e=>{if(r(e))return t=!0,!1})),t}function someAtRuleInTree(e,r){let t=!1;return e.walkAtRules((e=>{if(r(e))return t=!0,!1})),t}function getLayerAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(isProcessableLayerRule(r))return r;r=r.parent}else r=r.parent;return null}function removeEmptyDescendantBlocks(e){var r;e&&(e.walk((e=>{var r;("rule"===e.type||"atrule"===e.type&&["layer",...o].includes(e.name.toLowerCase()))&&(0===(null==(r=e.nodes)?void 0:r.length)&&e.remove())})),0===(null==(r=e.nodes)?void 0:r.length)&&e.remove())}function removeEmptyAncestorBlocks(e){if(!e)return;let r=e;for(;r;){if(void 0===r.nodes)return;if(r.nodes.length>0)return;const e=r.parent;r.remove(),r=e}}function desugarAndParseLayerNames(r,a){r.walkAtRules((r=>{if(!isProcessableLayerRule(r))return;if(r.params){const s=[];let n=!1;if(e().astSync(r.params).each((e=>{const r=[];e.walk((e=>{switch(e.type){case"class":case"tag":r.push(e.value);break;default:n=!0}})),n||(s.push(r.join(".")),a.addLayerNameParts(r))})),a.addLayerParams(r.params,s),r.nodes&&s.length>1&&(n=!0),n)return void(r.name=t);if(!r.nodes||0===r.nodes.length){if(s.length<=1)return;return s.slice(0,-1).forEach((e=>{a.addLayerParams(e,e),r.cloneBefore({params:e})})),a.addLayerParams(s[s.length-1],s[s.length-1]),void(r.params=s[s.length-1])}}r.params||(r.raws.afterName=" ",r.params=a.createAnonymousLayerName());const s=someAtRuleInTree(r,(e=>isProcessableLayerRule(e))),n=someInTree(r,(e=>{if("rule"!==e.type)return!1;return getLayerAtRuleAncestor(e)===r}));if(s&&n){const e=a.createImplicitLayerName(r.params),t=r.clone({params:e});t.walkAtRules((e=>{isProcessableLayerRule(e)&&e.remove()})),r.walk((e=>{if("atrule"===e.type&&isProcessableLayerRule(e))return;if("atrule"===e.type&&o.includes(e.name.toLowerCase()))return;getLayerAtRuleAncestor(e)===r&&e.remove()})),r.append(t),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)}}))}function desugarNestedLayers(e,r){for(;someAtRuleInTree(e,(e=>e.nodes&&someAtRuleInTree(e,(e=>isProcessableLayerRule(e)))));){let t=!1;if(e.walkAtRules((a=>{var s,n;if(isProcessableLayerRule(a)&&a.parent!==e){if("atrule"===(null==(s=a.parent)?void 0:s.type)&&isProcessableLayerRule(a.parent)){const e=a.parent;{const t=r.layerNameParts.get(e.params),s=r.layerNameParts.get(a.params);if(!t||!s)return;r.layerNameParts.set(`${e.params}.${a.params}`,[...t,...s]),r.layerParamsParsed.set(`${e.params}.${a.params}`,[`${e.params}.${a.params}`])}return a.params=`${e.params}.${a.params}`,e.before(a),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}if("atrule"===(null==(n=a.parent)?void 0:n.type)){const e=a.parent,r=e.clone(),t=a.clone();return r.removeAll(),t.removeAll(),r.append(a.nodes),t.append(r),e.before(t),a.remove(),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}t=!0}})),t)break}}function sortRootNodes(e,r){e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const r=e.clone(),t=e.clone();r.walkAtRules((e=>{if(l.includes(e.name.toLowerCase())){const r=e.parent;return e.remove(),removeEmptyDescendantBlocks(r),void removeEmptyAncestorBlocks(r)}if(someInTree(e,(e=>"rule"===e.type)))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkAtRules((e=>{if(o.includes(e.name.toLowerCase()))return removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)})),r.name=a,e.replaceWith(r,t),0===r.nodes.length&&r.remove(),0===t.nodes.length&&t.remove()})),e.nodes.sort(((e,t)=>{const a="atrule"===e.type&&"layer"===e.name.toLowerCase(),s="atrule"===t.type&&"layer"===t.name.toLowerCase();if(a&&s){return(r.layerOrder.get(e.params)??0)-(r.layerOrder.get(t.params)??0)}return a!==s?a?-1:1:0})),e.walkAtRules(a,(e=>{e.name="layer"}))}function getConditionalAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(o.includes(r.name.toLowerCase()))return r;r=r.parent}else r=r.parent;return null}function recordLayerOrder(e,r,{result:t,options:a}){e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const o=r.getLayerParams(e),l=o.join(".");r.layerOrder.has(l)||(a.onConditionalRulesChangingLayerOrder&&getConditionalAtRuleAncestor(e)&&!e.params.endsWith(n)&&!e.params.endsWith(s)&&e.warn(t,"handling different layer orders in conditional rules is unsupported by this plugin and will cause style differences between browser versions."),r.layerParamsParsed.has(l)||r.layerParamsParsed.set(l,[l]),r.layerNameParts.has(l)||r.layerNameParts.set(l,[...o]),r.getLayerNameList(l).forEach((e=>{r.layerOrder.has(e)||(r.layerOrder.set(e,r.layerCount),r.layerCount+=1)}))),e.nodes&&0!==e.nodes.length||e.remove()}))}function splitImportantStyles(e){e.walkDecls((e=>{var r;if(!e.important)return;const t=e.parent;if(!t)return;if("atrule"===(null==t||null==(r=t.parent)?void 0:r.type)&&l.includes(t.parent.name.toLowerCase()))return;const a=t.clone();a.each((e=>{"decl"===e.type&&e.important||e.remove()})),t.each((e=>{"decl"===e.type&&e.important&&e.remove()})),t.before(a),removeEmptyDescendantBlocks(t)}))}const creator=a=>{const s=Object.assign({onRevertLayerKeyword:"warn",onConditionalRulesChangingLayerOrder:"warn",onImportLayerRule:"warn"},a);return{postcssPlugin:"postcss-cascade-layers",OnceExit(a,{result:n}){s.onRevertLayerKeyword&&a.walkDecls((e=>{"revert-layer"===e.value.toLowerCase()&&e.warn(n,'handling "revert-layer" is unsupported by this plugin and will cause style differences between browser versions.')})),s.onImportLayerRule&&a.walkAtRules((e=>{"import"===e.name.toLowerCase()&&e.params.toLowerCase().includes("layer")&&e.warn(n,"To use @import with layers, the postcss-import plugin is also required. This plugin alone will not support using the @import at-rule.")})),splitImportantStyles(a);const o=new Model;if(desugarAndParseLayerNames(a,o),recordLayerOrder(a,o,{result:n,options:s}),!o.layerCount)return void a.walkAtRules(t,(e=>{e.name="layer"}));let i=0;for(a.walkRules((t=>{t.selectors.forEach((a=>{try{const t=r(e().astSync(a));i=Math.max(i,t.a+1)}catch(e){t.warn(n,`Failed to parse selector : "${a}" with message: "${e.message}"`)}}))})),a.walkRules((e=>{e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase())||getLayerAtRuleAncestor(e)||e.some((e=>"decl"===e.type&&e.important))||(e.selectors=e.selectors.map((r=>{try{return adjustSelectorSpecificity(r,o.layerCount*i)}catch(t){e.warn(n,`Failed to parse selector : "${r}" with message: "${t.message}"`)}return r})))})),o.sortLayerNames(),desugarNestedLayers(a,o),sortRootNodes(a,o),a.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=getLayerAtRuleAncestor(e);if(!r)return;const t=o.getLayerParams(r).join(".");let a=(o.layerOrder.get(t)??0)*i;e.some((e=>"decl"===e.type&&e.important))&&(a=o.layerCount-a),e.selectors=e.selectors.map((e=>adjustSelectorSpecificity(e,a)))}));someAtRuleInTree(a,(e=>isProcessableLayerRule(e)));)a.walkAtRules((e=>{isProcessableLayerRule(e)&&e.replaceWith(e.nodes)}));a.walkAtRules(t,(e=>{e.name="layer"}))}}};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/is-processable-layer-rule.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/is-processable-layer-rule.d.ts new file mode 100644 index 00000000..115b5dba --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/dist/is-processable-layer-rule.d.ts @@ -0,0 +1,2 @@ +import type { AtRule } from 'postcss'; +export declare function isProcessableLayerRule(atRule: AtRule): boolean; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/model.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/model.d.ts new file mode 100644 index 00000000..38a268e4 --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/dist/model.d.ts @@ -0,0 +1,18 @@ +import type { AtRule } from 'postcss'; +export declare class Model { + anonymousLayerCount: number; + layerCount: number; + layerOrder: Map<string, number>; + layerParamsParsed: Map<string, Array<string>>; + layerNameParts: Map<string, Array<string>>; + constructor(); + createAnonymousLayerName(): string; + createImplicitLayerName(layerName: string): string; + addLayerParams(key: string, parts?: string): void; + addLayerParams(key: string, parts: Array<string>): void; + addLayerNameParts(parts: string): void; + addLayerNameParts(parts: Array<string>): void; + getLayerParams(layer: AtRule): Array<string>; + getLayerNameList(layerName: string): Array<string>; + sortLayerNames(): void; +} diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/options.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/options.d.ts new file mode 100644 index 00000000..e3a1943d --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/dist/options.d.ts @@ -0,0 +1,9 @@ +/** postcss-cascasde-layers plugin options */ +export type pluginOptions = { + /** Emit a warning when the "revert" keyword is found in your CSS. default: "warn" */ + onRevertLayerKeyword?: 'warn' | false; + /** Emit a warning when conditional rules could change the layer order. default: "warn" */ + onConditionalRulesChangingLayerOrder?: 'warn' | false; + /** Emit a warning when "layer" is used in "@import". default: "warn" */ + onImportLayerRule?: 'warn' | false; +}; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/record-layer-order.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/record-layer-order.d.ts new file mode 100644 index 00000000..05d6ac7d --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/dist/record-layer-order.d.ts @@ -0,0 +1,7 @@ +import type { Container, Result } from 'postcss'; +import type { Model } from './model'; +import { pluginOptions } from './options'; +export declare function recordLayerOrder(root: Container, model: Model, { result, options }: { + result: Result; + options: pluginOptions; +}): void; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/some-in-tree.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/some-in-tree.d.ts new file mode 100644 index 00000000..8c416c59 --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/dist/some-in-tree.d.ts @@ -0,0 +1,3 @@ +import type { Container, ChildNode, AtRule } from 'postcss'; +export declare function someInTree(container: Container, predicate: (node: ChildNode) => boolean): boolean; +export declare function someAtRuleInTree(container: Container, predicate: (node: AtRule) => boolean): boolean; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/sort-root-nodes.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/sort-root-nodes.d.ts new file mode 100644 index 00000000..8eb479ed --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/dist/sort-root-nodes.d.ts @@ -0,0 +1,3 @@ +import type { Container } from 'postcss'; +import type { Model } from './model'; +export declare function sortRootNodes(root: Container, model: Model): void; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/split-important-styles.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/split-important-styles.d.ts new file mode 100644 index 00000000..270c69a9 --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/dist/split-important-styles.d.ts @@ -0,0 +1,2 @@ +import type { Container } from 'postcss'; +export declare function splitImportantStyles(root: Container): void; diff --git a/node_modules/@csstools/postcss-cascade-layers/package.json b/node_modules/@csstools/postcss-cascade-layers/package.json new file mode 100644 index 00000000..62751263 --- /dev/null +++ b/node_modules/@csstools/postcss-cascade-layers/package.json @@ -0,0 +1,102 @@ +{ + "name": "@csstools/postcss-cascade-layers", + "description": "Use cascade layers in CSS", + "version": "4.0.0", + "contributors": [ + { + "name": "Olu Niyi-Awosusi", + "email": "o.niyiawosusi@gmail.com" + }, + { + "name": "Sana Javed", + "email": "sanajaved7@gmail.com" + }, + { + "name": "Antonio Laguna", + "email": "antonio@laguna.es", + "url": "https://antonio.laguna.es" + }, + { + "name": "Romain Menke", + "email": "romainmenke@gmail.com" + } + ], + "license": "MIT-0", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" + }, + "main": "dist/index.cjs", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.cjs", + "default": "./dist/index.mjs" + } + }, + "files": [ + "CHANGELOG.md", + "LICENSE.md", + "README.md", + "dist" + ], + "dependencies": { + "@csstools/selector-specificity": "^3.0.0", + "postcss-selector-parser": "^6.0.13" + }, + "peerDependencies": { + "postcss": "^8.4" + }, + "devDependencies": { + "@csstools/postcss-tape": "*", + "postcss-import": "^15.1.0", + "puppeteer": "^20.7.4" + }, + "scripts": { + "build": "rollup -c ../../rollup/default.mjs", + "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", + "lint": "node ../../.github/bin/format-package-json.mjs", + "prepublishOnly": "npm run build && npm run test", + "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", + "test:browser": "node ./test/_browser.mjs", + "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" + }, + "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-cascade-layers#readme", + "repository": { + "type": "git", + "url": "https://github.com/csstools/postcss-plugins.git", + "directory": "plugins/postcss-cascade-layers" + }, + "bugs": "https://github.com/csstools/postcss-plugins/issues", + "keywords": [ + "cascade", + "css", + "layers", + "postcss", + "postcss-plugin", + "selectors", + "specificity" + ], + "csstools": { + "assumesToProcessBundledCSS": true, + "cssdbId": "cascade-layers", + "exportName": "postcssCascadeLayers", + "humanReadableName": "PostCSS Cascade Layers", + "specUrl": "https://www.w3.org/TR/css-cascade-5/#layering" + }, + "volta": { + "extends": "../../package.json" + } +} |
