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-scope-pseudo-class | |
| parent | 3fd9400d4dccc25aa29b5702216732e0b7542073 (diff) | |
postcss,(plugins): nanocss, postcss-preset-env
Diffstat (limited to 'node_modules/@csstools/postcss-scope-pseudo-class')
7 files changed, 228 insertions, 0 deletions
diff --git a/node_modules/@csstools/postcss-scope-pseudo-class/CHANGELOG.md b/node_modules/@csstools/postcss-scope-pseudo-class/CHANGELOG.md new file mode 100644 index 00000000..18bfb712 --- /dev/null +++ b/node_modules/@csstools/postcss-scope-pseudo-class/CHANGELOG.md @@ -0,0 +1,32 @@ +# Changes to PostCSS Scope Pseudo Class + +### 3.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/)) + +### 2.0.2 + +_February 9, 2023_ + +- Reduce the amount of duplicate fallback CSS. + +### 2.0.1 + +_January 28, 2023_ + +- Improve `types` declaration in `package.json` + +### 2.0.0 + +_January 24, 2023_ + +- Updated: Support for Node v14+ (major). +- Fix: Do not throw when a selector is invalid, show a warning instead. + +### 1.0.0 + +_November 4, 2022_ + +- Initial version diff --git a/node_modules/@csstools/postcss-scope-pseudo-class/LICENSE.md b/node_modules/@csstools/postcss-scope-pseudo-class/LICENSE.md new file mode 100644 index 00000000..e8ae93b9 --- /dev/null +++ b/node_modules/@csstools/postcss-scope-pseudo-class/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-scope-pseudo-class/README.md b/node_modules/@csstools/postcss-scope-pseudo-class/README.md new file mode 100644 index 00000000..eb1ff5ba --- /dev/null +++ b/node_modules/@csstools/postcss-scope-pseudo-class/README.md @@ -0,0 +1,82 @@ +# PostCSS Scope Pseudo Class [<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-scope-pseudo-class.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/scope-pseudo-class.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 Scope Pseudo Class] lets you use the `:scope` Pseudo-class following the [Selectors 4 specification]. + +```pcss +:scope { + color: green; +} + +/* becomes */ + +:root { + color: green; +} +``` + +## Usage + +Add [PostCSS Scope Pseudo Class] to your project: + +```bash +npm install postcss @csstools/postcss-scope-pseudo-class --save-dev +``` + +Use it as a [PostCSS] plugin: + +```js +const postcss = require('postcss'); +const postcssScopePseudoClass = require('@csstools/postcss-scope-pseudo-class'); + +postcss([ + postcssScopePseudoClass(/* pluginOptions */) +]).process(YOUR_CSS /*, processOptions */); +``` + +[PostCSS Scope Pseudo Class] 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 + +### preserve + +The `preserve` option determines whether the original notation +is preserved. By default, it is not preserved. + +```js +postcssScopePseudoClass({ preserve: true }) +``` + +```pcss +:scope { + color: green; +} + +/* becomes */ + +:root { + color: green; +} +:scope { + color: green; +} +``` + +[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test +[css-url]: https://cssdb.org/#scope-pseudo-class +[discord]: https://discord.gg/bUadyRwkJS +[npm-url]: https://www.npmjs.com/package/@csstools/postcss-scope-pseudo-class + +[PostCSS]: https://github.com/postcss/postcss +[PostCSS Scope Pseudo Class]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-scope-pseudo-class +[Selectors 4 specification]: https://www.w3.org/TR/selectors-4/#the-scope-pseudo diff --git a/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.cjs b/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.cjs new file mode 100644 index 00000000..e4bc3bd9 --- /dev/null +++ b/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.cjs @@ -0,0 +1 @@ +"use strict";var e=require("postcss-selector-parser");const creator=s=>{const r=Object.assign({preserve:!1},s);return{postcssPlugin:"postcss-scope-pseudo-class",prepare(){const s=new WeakSet;return{Rule(t,{result:o}){if(!t.selector.toLowerCase().includes(":scope"))return;if(s.has(t))return;{let e=t.parent;for(;e;){if("atrule"===e.type&&"scope"===e.name.toLowerCase())return;e=e.parent}}let a=t.selector;try{const s=e().astSync(a);if(!s)return;s.walkPseudos((e=>{if(":has"===e.value.toLowerCase())return!1;":scope"===e.value.toLowerCase()&&(e.value=":root")})),a=s.toString()}catch(e){t.warn(o,`Failed to parse selector : "${t.selector}" with message: "${e.message}"`)}a!==t.selector&&(s.add(t),t.cloneBefore({selector:a}),r.preserve||t.remove())}}}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.d.ts b/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.d.ts new file mode 100644 index 00000000..77dc51e7 --- /dev/null +++ b/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.d.ts @@ -0,0 +1,8 @@ +import type { PluginCreator } from 'postcss'; +/** postcss-scope-pseudo-class plugin options */ +export type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator<pluginOptions>; +export default creator; diff --git a/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.mjs b/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.mjs new file mode 100644 index 00000000..76a5d07b --- /dev/null +++ b/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.mjs @@ -0,0 +1 @@ +import e from"postcss-selector-parser";const creator=s=>{const r=Object.assign({preserve:!1},s);return{postcssPlugin:"postcss-scope-pseudo-class",prepare(){const s=new WeakSet;return{Rule(t,{result:o}){if(!t.selector.toLowerCase().includes(":scope"))return;if(s.has(t))return;{let e=t.parent;for(;e;){if("atrule"===e.type&&"scope"===e.name.toLowerCase())return;e=e.parent}}let a=t.selector;try{const s=e().astSync(a);if(!s)return;s.walkPseudos((e=>{if(":has"===e.value.toLowerCase())return!1;":scope"===e.value.toLowerCase()&&(e.value=":root")})),a=s.toString()}catch(e){t.warn(o,`Failed to parse selector : "${t.selector}" with message: "${e.message}"`)}a!==t.selector&&(s.add(t),t.cloneBefore({selector:a}),r.preserve||t.remove())}}}}};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-scope-pseudo-class/package.json b/node_modules/@csstools/postcss-scope-pseudo-class/package.json new file mode 100644 index 00000000..2e67a480 --- /dev/null +++ b/node_modules/@csstools/postcss-scope-pseudo-class/package.json @@ -0,0 +1,86 @@ +{ + "name": "@csstools/postcss-scope-pseudo-class", + "description": "The Reference Element Pseudo-class: :scope", + "version": "3.0.0", + "contributors": [ + { + "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": { + "postcss-selector-parser": "^6.0.13" + }, + "peerDependencies": { + "postcss": "^8.4" + }, + "devDependencies": { + "@csstools/postcss-tape": "*" + }, + "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:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" + }, + "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-scope-pseudo-class#readme", + "repository": { + "type": "git", + "url": "https://github.com/csstools/postcss-plugins.git", + "directory": "plugins/postcss-scope-pseudo-class" + }, + "bugs": "https://github.com/csstools/postcss-plugins/issues", + "keywords": [ + "postcss-plugin", + "pseudo", + "scope", + "selector" + ], + "csstools": { + "cssdbId": "scope-pseudo-class", + "exportName": "postcssScopePseudoClass", + "humanReadableName": "PostCSS Scope Pseudo Class", + "specUrl": "https://www.w3.org/TR/selectors-4/#the-scope-pseudo" + }, + "volta": { + "extends": "../../package.json" + } +} |
