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/postcss-attribute-case-insensitive | |
| parent | 3fd9400d4dccc25aa29b5702216732e0b7542073 (diff) | |
postcss,(plugins): nanocss, postcss-preset-env
Diffstat (limited to 'node_modules/postcss-attribute-case-insensitive')
7 files changed, 235 insertions, 0 deletions
diff --git a/node_modules/postcss-attribute-case-insensitive/CHANGELOG.md b/node_modules/postcss-attribute-case-insensitive/CHANGELOG.md new file mode 100644 index 00000000..1ddcf776 --- /dev/null +++ b/node_modules/postcss-attribute-case-insensitive/CHANGELOG.md @@ -0,0 +1,35 @@ +# Changes to PostCSS Attribute Case Insensitive + +### 6.0.2 (February 6, 2023) + +- Reduce the amount of duplicate fallback CSS. + +### 6.0.1 (January 28, 2023) + +- Improve `types` declaration in `package.json` + +### 6.0.0 (January 24, 2023) + +- Updated: Support for Node v14+ (major). +- Fix: Do not throw when a selector is invalid, show a warning instead. +- Added: `preserve` plugin option. + +### 5.0.2 (July 8, 2022) + +- Fix incorrect selector AST updates + +### 5.0.1 (June 3, 2022) + +- Prevent exponential backtracking when checking for selectors with case insensitive value matching. + +### 5.0.0 (September 15, 2020) + +- Postcss 8.x support + +### 4.0.1 (January 10, 2019) + +### 2.0.0 (May 06, 2017) + +### 1.0.1 (August 19, 2016) + +### 1.0.0 (August 10, 2016) diff --git a/node_modules/postcss-attribute-case-insensitive/LICENSE b/node_modules/postcss-attribute-case-insensitive/LICENSE new file mode 100644 index 00000000..b701cfee --- /dev/null +++ b/node_modules/postcss-attribute-case-insensitive/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2020 Dmitry Semigradsky <semigradskyd@gmail.com> + +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, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +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/postcss-attribute-case-insensitive/README.md b/node_modules/postcss-attribute-case-insensitive/README.md new file mode 100644 index 00000000..60c9608b --- /dev/null +++ b/node_modules/postcss-attribute-case-insensitive/README.md @@ -0,0 +1,82 @@ +# PostCSS Attribute Case Insensitive [<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/postcss-attribute-case-insensitive.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/case-insensitive-attributes.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 Attribute Case Insensitive] enables support for [Case Insensitive Attribute] matching in selectors. + +```pcss +[frame=hsides i] { + border-style: solid none; +} + +/* becomes */ + +[frame=hsides],[frame=Hsides],[frame=hSides],[frame=HSides],[frame=hsIdes],[frame=HsIdes],[frame=hSIdes],[frame=HSIdes],[frame=hsiDes],[frame=HsiDes],[frame=hSiDes],[frame=HSiDes],[frame=hsIDes],[frame=HsIDes],[frame=hSIDes],[frame=HSIDes],[frame=hsidEs],[frame=HsidEs],[frame=hSidEs],[frame=HSidEs],[frame=hsIdEs],[frame=HsIdEs],[frame=hSIdEs],[frame=HSIdEs],[frame=hsiDEs],[frame=HsiDEs],[frame=hSiDEs],[frame=HSiDEs],[frame=hsIDEs],[frame=HsIDEs],[frame=hSIDEs],[frame=HSIDEs],[frame=hsideS],[frame=HsideS],[frame=hSideS],[frame=HSideS],[frame=hsIdeS],[frame=HsIdeS],[frame=hSIdeS],[frame=HSIdeS],[frame=hsiDeS],[frame=HsiDeS],[frame=hSiDeS],[frame=HSiDeS],[frame=hsIDeS],[frame=HsIDeS],[frame=hSIDeS],[frame=HSIDeS],[frame=hsidES],[frame=HsidES],[frame=hSidES],[frame=HSidES],[frame=hsIdES],[frame=HsIdES],[frame=hSIdES],[frame=HSIdES],[frame=hsiDES],[frame=HsiDES],[frame=hSiDES],[frame=HSiDES],[frame=hsIDES],[frame=HsIDES],[frame=hSIDES],[frame=HSIDES] { + border-style: solid none; +} +``` + +## Usage + +Add [PostCSS Attribute Case Insensitive] to your project: + +```bash +npm install postcss postcss-attribute-case-insensitive --save-dev +``` + +Use it as a [PostCSS] plugin: + +```js +const postcss = require('postcss'); +const postcssAttributeCaseInsensitive = require('postcss-attribute-case-insensitive'); + +postcss([ + postcssAttributeCaseInsensitive(/* pluginOptions */) +]).process(YOUR_CSS /*, processOptions */); +``` + +[PostCSS Attribute Case Insensitive] 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 +postcssAttributeCaseInsensitive({ preserve: true }) +``` + +```pcss +[frame=hsides i] { + border-style: solid none; +} + +/* becomes */ + +[frame=hsides],[frame=Hsides],[frame=hSides],[frame=HSides],[frame=hsIdes],[frame=HsIdes],[frame=hSIdes],[frame=HSIdes],[frame=hsiDes],[frame=HsiDes],[frame=hSiDes],[frame=HSiDes],[frame=hsIDes],[frame=HsIDes],[frame=hSIDes],[frame=HSIDes],[frame=hsidEs],[frame=HsidEs],[frame=hSidEs],[frame=HSidEs],[frame=hsIdEs],[frame=HsIdEs],[frame=hSIdEs],[frame=HSIdEs],[frame=hsiDEs],[frame=HsiDEs],[frame=hSiDEs],[frame=HSiDEs],[frame=hsIDEs],[frame=HsIDEs],[frame=hSIDEs],[frame=HSIDEs],[frame=hsideS],[frame=HsideS],[frame=hSideS],[frame=HSideS],[frame=hsIdeS],[frame=HsIdeS],[frame=hSIdeS],[frame=HSIdeS],[frame=hsiDeS],[frame=HsiDeS],[frame=hSiDeS],[frame=HSiDeS],[frame=hsIDeS],[frame=HsIDeS],[frame=hSIDeS],[frame=HSIDeS],[frame=hsidES],[frame=HsidES],[frame=hSidES],[frame=HSidES],[frame=hsIdES],[frame=HsIdES],[frame=hSIdES],[frame=HSIdES],[frame=hsiDES],[frame=HsiDES],[frame=hSiDES],[frame=HSiDES],[frame=hsIDES],[frame=HsIDES],[frame=hSIDES],[frame=HSIDES] { + border-style: solid none; +} +[frame=hsides i] { + border-style: solid none; +} +``` + +[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test +[css-url]: https://cssdb.org/#case-insensitive-attributes +[discord]: https://discord.gg/bUadyRwkJS +[npm-url]: https://www.npmjs.com/package/postcss-attribute-case-insensitive + +[PostCSS]: https://github.com/postcss/postcss +[PostCSS Attribute Case Insensitive]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-attribute-case-insensitive +[Case Insensitive Attribute]: https://www.w3.org/TR/selectors4/#attribute-case diff --git a/node_modules/postcss-attribute-case-insensitive/dist/index.cjs b/node_modules/postcss-attribute-case-insensitive/dist/index.cjs new file mode 100644 index 00000000..85dc2694 --- /dev/null +++ b/node_modules/postcss-attribute-case-insensitive/dist/index.cjs @@ -0,0 +1 @@ +"use strict";var e=require("postcss-selector-parser");function nodeIsInsensitiveAttribute(e){return"attribute"===e.type&&e.insensitive}function selectorHasInsensitiveAttribute(e){return e.some(nodeIsInsensitiveAttribute)}function transformString(e,t,r){const s=r.charAt(t);if(""===s)return e;let n=e.map((e=>e+s));const o=s.toLocaleUpperCase();return o!==s&&(n=n.concat(e.map((e=>e+o)))),transformString(n,t+1,r)}function createNewSelectors(t){let r=[e.selector({value:"",nodes:[]})];return t.walk((e=>{if(!nodeIsInsensitiveAttribute(e))return void r.forEach((t=>{t.append(e.clone())}));const t=transformString([""],0,(s=e).value).map((e=>{const t=s.clone({spaces:{after:s.spaces.after,before:s.spaces.before},insensitive:!1});return t.setValue(e),t}));var s;const n=[];t.forEach((e=>{r.forEach((t=>{const r=t.clone({});r.append(e),n.push(r)}))})),r=n})),r}function transform(e){let t=[];e.each((e=>{selectorHasInsensitiveAttribute(e)&&(t=t.concat(createNewSelectors(e)),e.remove())})),t.length&&t.forEach((t=>e.append(t)))}const creator=t=>{const r=Object.assign({preserve:!1},t);return{postcssPlugin:"postcss-attribute-case-insensitive",prepare(){const t=new WeakSet;return{Rule(s,{result:n}){if(t.has(s))return;if(!/i\s*]/gim.test(s.selector))return;let o=s.selector;try{o=e(transform).processSync(s.selector)}catch(e){return void s.warn(n,`Failed to parse selector : "${s.selector}" with message: "${e.message}"`)}o!==s.selector&&(t.add(s),s.cloneBefore({selector:o}),r.preserve||s.remove())}}}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/postcss-attribute-case-insensitive/dist/index.d.ts b/node_modules/postcss-attribute-case-insensitive/dist/index.d.ts new file mode 100644 index 00000000..c3aecebb --- /dev/null +++ b/node_modules/postcss-attribute-case-insensitive/dist/index.d.ts @@ -0,0 +1,8 @@ +import type { PluginCreator } from 'postcss'; +/** postcss-prefers-color-scheme 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/postcss-attribute-case-insensitive/dist/index.mjs b/node_modules/postcss-attribute-case-insensitive/dist/index.mjs new file mode 100644 index 00000000..43611995 --- /dev/null +++ b/node_modules/postcss-attribute-case-insensitive/dist/index.mjs @@ -0,0 +1 @@ +import e from"postcss-selector-parser";function nodeIsInsensitiveAttribute(e){return"attribute"===e.type&&e.insensitive}function selectorHasInsensitiveAttribute(e){return e.some(nodeIsInsensitiveAttribute)}function transformString(e,t,r){const s=r.charAt(t);if(""===s)return e;let n=e.map((e=>e+s));const o=s.toLocaleUpperCase();return o!==s&&(n=n.concat(e.map((e=>e+o)))),transformString(n,t+1,r)}function createNewSelectors(t){let r=[e.selector({value:"",nodes:[]})];return t.walk((e=>{if(!nodeIsInsensitiveAttribute(e))return void r.forEach((t=>{t.append(e.clone())}));const t=transformString([""],0,(s=e).value).map((e=>{const t=s.clone({spaces:{after:s.spaces.after,before:s.spaces.before},insensitive:!1});return t.setValue(e),t}));var s;const n=[];t.forEach((e=>{r.forEach((t=>{const r=t.clone({});r.append(e),n.push(r)}))})),r=n})),r}function transform(e){let t=[];e.each((e=>{selectorHasInsensitiveAttribute(e)&&(t=t.concat(createNewSelectors(e)),e.remove())})),t.length&&t.forEach((t=>e.append(t)))}const creator=t=>{const r=Object.assign({preserve:!1},t);return{postcssPlugin:"postcss-attribute-case-insensitive",prepare(){const t=new WeakSet;return{Rule(s,{result:n}){if(t.has(s))return;if(!/i\s*]/gim.test(s.selector))return;let o=s.selector;try{o=e(transform).processSync(s.selector)}catch(e){return void s.warn(n,`Failed to parse selector : "${s.selector}" with message: "${e.message}"`)}o!==s.selector&&(t.add(s),s.cloneBefore({selector:o}),r.preserve||s.remove())}}}}};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/postcss-attribute-case-insensitive/package.json b/node_modules/postcss-attribute-case-insensitive/package.json new file mode 100644 index 00000000..ccebaa56 --- /dev/null +++ b/node_modules/postcss-attribute-case-insensitive/package.json @@ -0,0 +1,88 @@ +{ + "name": "postcss-attribute-case-insensitive", + "description": "Enable support for case insensitive attribute matching in selectors", + "version": "6.0.2", + "contributors": [ + { + "name": "Antonio Laguna", + "email": "antonio@laguna.es", + "url": "https://antonio.laguna.es" + }, + { + "name": "Romain Menke", + "email": "romainmenke@gmail.com" + }, + { + "name": "Dmitry Semigradsky" + } + ], + "license": "MIT", + "funding": { + "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", + "README.md", + "dist" + ], + "dependencies": { + "postcss-selector-parser": "^6.0.10" + }, + "peerDependencies": { + "postcss": "^8.4" + }, + "scripts": { + "prebuild": "npm run clean", + "build": "rollup -c ../../rollup/default.mjs", + "clean": "node -e \"fs.rmSync('./dist', { recursive: true, force: true }); fs.mkdirSync('./dist');\"", + "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", + "lint": "npm run lint:eslint && npm run lint:package-json", + "lint:eslint": "eslint ./src --ext .js --ext .ts --ext .mjs --no-error-on-unmatched-pattern", + "lint:package-json": "node ../../.github/bin/format-package-json.mjs", + "prepublishOnly": "npm run clean && npm run build && npm run test", + "test": "node .tape.mjs && npm run test:exports", + "test:exports": "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-attribute-case-insensitive#readme", + "repository": { + "type": "git", + "url": "https://github.com/csstools/postcss-plugins.git", + "directory": "plugins/postcss-attribute-case-insensitive" + }, + "bugs": "https://github.com/csstools/postcss-plugins/issues", + "keywords": [ + "attribute", + "css", + "CSS4", + "insensitive", + "postcss", + "postcss-plugin", + "sensitive" + ], + "csstools": { + "cssdbId": "case-insensitive-attributes", + "exportName": "postcssAttributeCaseInsensitive", + "humanReadableName": "PostCSS Attribute Case Insensitive", + "specUrl": "https://www.w3.org/TR/selectors4/#attribute-case" + }, + "volta": { + "extends": "../../package.json" + } +} |
