summaryrefslogtreecommitdiff
path: root/node_modules/@csstools/postcss-initial
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2023-10-14 15:05:55 +0800
committerlittleblack111 <littleblack11111@gmail.com>2023-10-14 15:05:55 +0800
commitc06f7ee0a40255214c477e13d9b956a7e07c2900 (patch)
treef5982a568ef8fab865d0142e71c7494fea3e4c1b /node_modules/@csstools/postcss-initial
parent3fd9400d4dccc25aa29b5702216732e0b7542073 (diff)
postcss,(plugins): nanocss, postcss-preset-env
Diffstat (limited to 'node_modules/@csstools/postcss-initial')
-rw-r--r--node_modules/@csstools/postcss-initial/CHANGELOG.md7
-rw-r--r--node_modules/@csstools/postcss-initial/LICENSE.md18
-rw-r--r--node_modules/@csstools/postcss-initial/README.md87
-rw-r--r--node_modules/@csstools/postcss-initial/dist/has-fallback-decl.d.ts2
-rw-r--r--node_modules/@csstools/postcss-initial/dist/index.cjs1
-rw-r--r--node_modules/@csstools/postcss-initial/dist/index.d.ts8
-rw-r--r--node_modules/@csstools/postcss-initial/dist/index.mjs1
-rw-r--r--node_modules/@csstools/postcss-initial/dist/properties.d.ts2
-rw-r--r--node_modules/@csstools/postcss-initial/package.json80
9 files changed, 206 insertions, 0 deletions
diff --git a/node_modules/@csstools/postcss-initial/CHANGELOG.md b/node_modules/@csstools/postcss-initial/CHANGELOG.md
new file mode 100644
index 00000000..296a43b5
--- /dev/null
+++ b/node_modules/@csstools/postcss-initial/CHANGELOG.md
@@ -0,0 +1,7 @@
+# Changes to PostCSS Initial
+
+### 1.0.0
+
+_September 18, 2023_
+
+- Initial version
diff --git a/node_modules/@csstools/postcss-initial/LICENSE.md b/node_modules/@csstools/postcss-initial/LICENSE.md
new file mode 100644
index 00000000..e8ae93b9
--- /dev/null
+++ b/node_modules/@csstools/postcss-initial/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-initial/README.md b/node_modules/@csstools/postcss-initial/README.md
new file mode 100644
index 00000000..26d6b14a
--- /dev/null
+++ b/node_modules/@csstools/postcss-initial/README.md
@@ -0,0 +1,87 @@
+# PostCSS Initial [<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-initial.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/all-property.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]
+
+```bash
+npm install @csstools/postcss-initial --save-dev
+```
+
+[PostCSS Initial] fallback the `initial` keyword following the [CSS Cascade 4 Specification].
+
+```pcss
+.foo {
+ border: initial;
+}
+
+/* becomes */
+
+.foo {
+ border: medium none currentcolor;
+ border: initial;
+}
+```
+
+_See prior work by [maximkoretskiy](https://github.com/maximkoretskiy) here [postcss-initial](https://github.com/maximkoretskiy/postcss-initial)
+To ensure long term maintenance and to provide the needed features this plugin was recreated based on maximkoretskiy's work._
+
+## Usage
+
+Add [PostCSS Initial] to your project:
+
+```bash
+npm install postcss @csstools/postcss-initial --save-dev
+```
+
+Use it as a [PostCSS] plugin:
+
+```js
+const postcss = require('postcss');
+const postcssInitial = require('@csstools/postcss-initial');
+
+postcss([
+ postcssInitial(/* pluginOptions */)
+]).process(YOUR_CSS /*, processOptions */);
+```
+
+[PostCSS Initial] 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 preserved.
+
+```js
+postcssInitial({ preserve: false })
+```
+
+```pcss
+.foo {
+ border: initial;
+}
+
+/* becomes */
+
+.foo {
+ border: medium none currentcolor;
+}
+```
+
+[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
+[css-url]: https://cssdb.org/#all-property
+[discord]: https://discord.gg/bUadyRwkJS
+[npm-url]: https://www.npmjs.com/package/@csstools/postcss-initial
+
+[PostCSS]: https://github.com/postcss/postcss
+[PostCSS Initial]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-initial
+[CSS Cascade 4 Specification]: https://www.w3.org/TR/css-cascade-4/#initial
diff --git a/node_modules/@csstools/postcss-initial/dist/has-fallback-decl.d.ts b/node_modules/@csstools/postcss-initial/dist/has-fallback-decl.d.ts
new file mode 100644
index 00000000..c044b787
--- /dev/null
+++ b/node_modules/@csstools/postcss-initial/dist/has-fallback-decl.d.ts
@@ -0,0 +1,2 @@
+import type { Declaration } from 'postcss';
+export declare function hasExactFallback(node: Declaration, newValue: string): boolean;
diff --git a/node_modules/@csstools/postcss-initial/dist/index.cjs b/node_modules/@csstools/postcss-initial/dist/index.cjs
new file mode 100644
index 00000000..a28e74ee
--- /dev/null
+++ b/node_modules/@csstools/postcss-initial/dist/index.cjs
@@ -0,0 +1 @@
+"use strict";const o=new Map([["animation","none 0s ease 0s 1 normal none running"],["animation-delay","0s"],["animation-direction","normal"],["animation-duration","0s"],["animation-fill-mode","none"],["animation-iteration-count","1"],["animation-name","none"],["animation-play-state","running"],["animation-timing-function","ease"],["backface-visibility","visible"],["background","transparent none repeat 0 0 / auto auto padding-box border-box scroll"],["background-attachment","scroll"],["background-clip","border-box"],["background-color","transparent"],["background-image","none"],["background-origin","padding-box"],["background-position","0 0"],["background-position-x","0"],["background-position-y","0"],["background-repeat","repeat"],["background-size","auto auto"],["border","medium none currentcolor"],["border-style","none"],["border-width","medium"],["border-color","currentcolor"],["border-bottom","0"],["border-bottom-color","currentcolor"],["border-bottom-left-radius","0"],["border-bottom-right-radius","0"],["border-bottom-style","none"],["border-bottom-width","medium"],["border-collapse","separate"],["border-image","none"],["border-left","0"],["border-left-color","currentcolor"],["border-left-style","none"],["border-left-width","medium"],["border-radius","0"],["border-right","0"],["border-right-color","currentcolor"],["border-right-style","none"],["border-right-width","medium"],["border-spacing","0"],["border-top","0"],["border-top-color","currentcolor"],["border-top-left-radius","0"],["border-top-right-radius","0"],["border-top-style","none"],["border-top-width","medium"],["bottom","auto"],["box-shadow","none"],["box-sizing","content-box"],["caption-side","top"],["clear","none"],["clip","auto"],["color","#000"],["columns","auto"],["column-count","auto"],["column-fill","balance"],["column-gap","normal"],["column-rule","medium none currentcolor"],["column-rule-color","currentcolor"],["column-rule-style","none"],["column-rule-width","medium"],["column-span","1"],["column-width","auto"],["content","normal"],["counter-increment","none"],["counter-reset","none"],["cursor","auto"],["direction","ltr"],["display","inline"],["empty-cells","show"],["float","none"],["font-family","serif"],["font-size","medium"],["font-style","normal"],["font-variant","normal"],["font-weight","normal"],["font-stretch","normal"],["line-height","normal"],["height","auto"],["hyphens","none"],["left","auto"],["letter-spacing","normal"],["list-style","disc outside none"],["list-style-image","none"],["list-style-position","outside"],["list-style-type","disc"],["margin","0"],["margin-bottom","0"],["margin-left","0"],["margin-right","0"],["margin-top","0"],["max-height","none"],["max-width","none"],["min-height","0"],["min-width","0"],["opacity","1"],["orphans","2"],["outline","medium none currentcolor"],["outline-color","currentcolor"],["outline-style","none"],["outline-width","medium"],["overflow","visible"],["overflow-x","visible"],["overflow-y","visible"],["padding","0"],["padding-bottom","0"],["padding-left","0"],["padding-right","0"],["padding-top","0"],["page-break-after","auto"],["page-break-before","auto"],["page-break-inside","auto"],["perspective","none"],["perspective-origin","50% 50%"],["position","static"],["quotes",'"“" "”" "‘" "’"'],["right","auto"],["tab-size","8"],["table-layout","auto"],["text-align","left"],["text-align-last","auto"],["text-decoration","none"],["text-decoration-color","currentcolor"],["text-decoration-line","none"],["text-decoration-style","solid"],["text-indent","0"],["text-shadow","none"],["text-transform","none"],["top","auto"],["transform","none"],["transform-origin","50% 50% 0"],["transform-style","flat"],["transition","none 0s ease 0s"],["transition-delay","0s"],["transition-duration","0s"],["transition-property","none"],["transition-timing-function","ease"],["unicode-bidi","normal"],["vertical-align","baseline"],["visibility","visible"],["white-space","normal"],["widows","2"],["width","auto"],["word-spacing","normal"],["z-index","auto"]]),t=["animation","backface-visibility","background","border","border-collapse","border-image","border-radius","border-spacing","bottom","box-shadow","box-sizing","caption-side","clear","clip","color","columns","column-count","column-fill","column-gap","column-rule","column-span","column-width","content","counter-increment","counter-reset","cursor","display","empty-cells","float","font-family","font-size","font-style","font-variant","font-weight","font-stretch","line-height","font","height","hyphens","left","letter-spacing","list-style","margin","max-height","max-width","min-height","min-width","opacity","orphans","outline","overflow","overflow-x","overflow-y","padding","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","position","right","tab-size","table-layout","text-align","text-align-last","text-decoration","text-indent","text-shadow","text-transform","top","transform","transform-origin","transform-style","transition","vertical-align","visibility","white-space","widows","width","word-spacing","z-index"];function hasExactFallback(o,t){const e=o.parent;if(!e)return!1;const n=o.prop.toLowerCase();for(let r=e.index(o)-1;r>=0;r--){const o=e.nodes[r];if("decl"===o.type&&o.prop.toLowerCase()===n)return o.value===t}return!1}const e=/^\s?initial\s?$/i,n=/^font$/i,r=/^all$/i,i=["font-family","font-size","font-style","font-variant","font-weight","font-stretch","line-height"],creator=a=>{const l=Object.assign({preserve:!0},a);return{postcssPlugin:"postcss-initial",Declaration(a){if(a.variable)return;if(!e.test(a.value))return;let s;s=n.test(a.prop)?i:r.test(a.prop)?t:[a.prop.toLowerCase()],s.forEach((t=>{const e=o.get(t);e&&(hasExactFallback(a,e)||a.cloneBefore({prop:t,value:e}))})),l.preserve||a.remove()}}};creator.postcss=!0,module.exports=creator;
diff --git a/node_modules/@csstools/postcss-initial/dist/index.d.ts b/node_modules/@csstools/postcss-initial/dist/index.d.ts
new file mode 100644
index 00000000..55f858c1
--- /dev/null
+++ b/node_modules/@csstools/postcss-initial/dist/index.d.ts
@@ -0,0 +1,8 @@
+import type { PluginCreator } from 'postcss';
+/** postcss-initial 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-initial/dist/index.mjs b/node_modules/@csstools/postcss-initial/dist/index.mjs
new file mode 100644
index 00000000..be1f1b9d
--- /dev/null
+++ b/node_modules/@csstools/postcss-initial/dist/index.mjs
@@ -0,0 +1 @@
+const o=new Map([["animation","none 0s ease 0s 1 normal none running"],["animation-delay","0s"],["animation-direction","normal"],["animation-duration","0s"],["animation-fill-mode","none"],["animation-iteration-count","1"],["animation-name","none"],["animation-play-state","running"],["animation-timing-function","ease"],["backface-visibility","visible"],["background","transparent none repeat 0 0 / auto auto padding-box border-box scroll"],["background-attachment","scroll"],["background-clip","border-box"],["background-color","transparent"],["background-image","none"],["background-origin","padding-box"],["background-position","0 0"],["background-position-x","0"],["background-position-y","0"],["background-repeat","repeat"],["background-size","auto auto"],["border","medium none currentcolor"],["border-style","none"],["border-width","medium"],["border-color","currentcolor"],["border-bottom","0"],["border-bottom-color","currentcolor"],["border-bottom-left-radius","0"],["border-bottom-right-radius","0"],["border-bottom-style","none"],["border-bottom-width","medium"],["border-collapse","separate"],["border-image","none"],["border-left","0"],["border-left-color","currentcolor"],["border-left-style","none"],["border-left-width","medium"],["border-radius","0"],["border-right","0"],["border-right-color","currentcolor"],["border-right-style","none"],["border-right-width","medium"],["border-spacing","0"],["border-top","0"],["border-top-color","currentcolor"],["border-top-left-radius","0"],["border-top-right-radius","0"],["border-top-style","none"],["border-top-width","medium"],["bottom","auto"],["box-shadow","none"],["box-sizing","content-box"],["caption-side","top"],["clear","none"],["clip","auto"],["color","#000"],["columns","auto"],["column-count","auto"],["column-fill","balance"],["column-gap","normal"],["column-rule","medium none currentcolor"],["column-rule-color","currentcolor"],["column-rule-style","none"],["column-rule-width","medium"],["column-span","1"],["column-width","auto"],["content","normal"],["counter-increment","none"],["counter-reset","none"],["cursor","auto"],["direction","ltr"],["display","inline"],["empty-cells","show"],["float","none"],["font-family","serif"],["font-size","medium"],["font-style","normal"],["font-variant","normal"],["font-weight","normal"],["font-stretch","normal"],["line-height","normal"],["height","auto"],["hyphens","none"],["left","auto"],["letter-spacing","normal"],["list-style","disc outside none"],["list-style-image","none"],["list-style-position","outside"],["list-style-type","disc"],["margin","0"],["margin-bottom","0"],["margin-left","0"],["margin-right","0"],["margin-top","0"],["max-height","none"],["max-width","none"],["min-height","0"],["min-width","0"],["opacity","1"],["orphans","2"],["outline","medium none currentcolor"],["outline-color","currentcolor"],["outline-style","none"],["outline-width","medium"],["overflow","visible"],["overflow-x","visible"],["overflow-y","visible"],["padding","0"],["padding-bottom","0"],["padding-left","0"],["padding-right","0"],["padding-top","0"],["page-break-after","auto"],["page-break-before","auto"],["page-break-inside","auto"],["perspective","none"],["perspective-origin","50% 50%"],["position","static"],["quotes",'"“" "”" "‘" "’"'],["right","auto"],["tab-size","8"],["table-layout","auto"],["text-align","left"],["text-align-last","auto"],["text-decoration","none"],["text-decoration-color","currentcolor"],["text-decoration-line","none"],["text-decoration-style","solid"],["text-indent","0"],["text-shadow","none"],["text-transform","none"],["top","auto"],["transform","none"],["transform-origin","50% 50% 0"],["transform-style","flat"],["transition","none 0s ease 0s"],["transition-delay","0s"],["transition-duration","0s"],["transition-property","none"],["transition-timing-function","ease"],["unicode-bidi","normal"],["vertical-align","baseline"],["visibility","visible"],["white-space","normal"],["widows","2"],["width","auto"],["word-spacing","normal"],["z-index","auto"]]),t=["animation","backface-visibility","background","border","border-collapse","border-image","border-radius","border-spacing","bottom","box-shadow","box-sizing","caption-side","clear","clip","color","columns","column-count","column-fill","column-gap","column-rule","column-span","column-width","content","counter-increment","counter-reset","cursor","display","empty-cells","float","font-family","font-size","font-style","font-variant","font-weight","font-stretch","line-height","font","height","hyphens","left","letter-spacing","list-style","margin","max-height","max-width","min-height","min-width","opacity","orphans","outline","overflow","overflow-x","overflow-y","padding","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","position","right","tab-size","table-layout","text-align","text-align-last","text-decoration","text-indent","text-shadow","text-transform","top","transform","transform-origin","transform-style","transition","vertical-align","visibility","white-space","widows","width","word-spacing","z-index"];function hasExactFallback(o,t){const e=o.parent;if(!e)return!1;const n=o.prop.toLowerCase();for(let r=e.index(o)-1;r>=0;r--){const o=e.nodes[r];if("decl"===o.type&&o.prop.toLowerCase()===n)return o.value===t}return!1}const e=/^\s?initial\s?$/i,n=/^font$/i,r=/^all$/i,i=["font-family","font-size","font-style","font-variant","font-weight","font-stretch","line-height"],creator=a=>{const l=Object.assign({preserve:!0},a);return{postcssPlugin:"postcss-initial",Declaration(a){if(a.variable)return;if(!e.test(a.value))return;let s;s=n.test(a.prop)?i:r.test(a.prop)?t:[a.prop.toLowerCase()],s.forEach((t=>{const e=o.get(t);e&&(hasExactFallback(a,e)||a.cloneBefore({prop:t,value:e}))})),l.preserve||a.remove()}}};creator.postcss=!0;export{creator as default};
diff --git a/node_modules/@csstools/postcss-initial/dist/properties.d.ts b/node_modules/@csstools/postcss-initial/dist/properties.d.ts
new file mode 100644
index 00000000..5345546e
--- /dev/null
+++ b/node_modules/@csstools/postcss-initial/dist/properties.d.ts
@@ -0,0 +1,2 @@
+export declare const properties: Map<string, string>;
+export declare const allProperties: string[];
diff --git a/node_modules/@csstools/postcss-initial/package.json b/node_modules/@csstools/postcss-initial/package.json
new file mode 100644
index 00000000..d5b6e09e
--- /dev/null
+++ b/node_modules/@csstools/postcss-initial/package.json
@@ -0,0 +1,80 @@
+{
+ "name": "@csstools/postcss-initial",
+ "description": "PostCSS plugin to fallback initial keyword.",
+ "version": "1.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"
+ ],
+ "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-initial#readme",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/csstools/postcss-plugins.git",
+ "directory": "plugins/postcss-initial"
+ },
+ "bugs": "https://github.com/csstools/postcss-plugins/issues",
+ "keywords": [
+ "postcss-plugin"
+ ],
+ "csstools": {
+ "cssdbId": "all-property",
+ "exportName": "postcssInitial",
+ "humanReadableName": "PostCSS Initial",
+ "specUrl": "https://www.w3.org/TR/css-cascade-4/#initial"
+ },
+ "volta": {
+ "extends": "../../package.json"
+ }
+}