From c06f7ee0a40255214c477e13d9b956a7e07c2900 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 14 Oct 2023 15:05:55 +0800 Subject: postcss,(plugins): nanocss, postcss-preset-env --- .../CHANGELOG.md | 129 ++++++++++++++++ .../LICENSE.md | 18 +++ .../README.md | 169 +++++++++++++++++++++ .../dist/color-stop-list.d.ts | 9 ++ .../dist/has-fallback-decl.d.ts | 2 + .../dist/has-supports-at-rule-ancestor.d.ts | 2 + .../dist/index.cjs | 1 + .../dist/index.d.ts | 10 ++ .../dist/index.mjs | 1 + .../dist/is-gradient.d.ts | 2 + .../dist/modify-gradient-component-values.d.ts | 2 + .../dist/parse-color-stops.d.ts | 3 + .../package.json | 88 +++++++++++ 13 files changed, 436 insertions(+) create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/CHANGELOG.md create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/LICENSE.md create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/README.md create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/color-stop-list.d.ts create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-fallback-decl.d.ts create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-supports-at-rule-ancestor.d.ts create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.cjs create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.d.ts create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.mjs create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/is-gradient.d.ts create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/modify-gradient-component-values.d.ts create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/parse-color-stops.d.ts create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/package.json (limited to 'node_modules/@csstools/postcss-gradients-interpolation-method') diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/CHANGELOG.md b/node_modules/@csstools/postcss-gradients-interpolation-method/CHANGELOG.md new file mode 100644 index 00000000..1c0818d0 --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/CHANGELOG.md @@ -0,0 +1,129 @@ +# Changes to PostCSS Gradients Interpolation Method + +### 4.0.7 + +_October 9, 2023_ + +- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#140) (minor) +- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.2`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#302) (patch) + +### 4.0.6 + +_October 2, 2023_ + +- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#133) (patch) + +### 4.0.5 + +_September 24, 2023_ + +- Small performance improvements +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#232) (patch) +- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#132) (patch) + +### 4.0.4 + +_September 18, 2023_ + +- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.1`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#301) (patch) + +### 4.0.3 + +_September 2, 2023_ + +- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#131) (patch) + +### 4.0.2 + +_August 28, 2023_ + +- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#130) (minor) + +### 4.0.1 + +_July 24, 2023_ + +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#220) (minor) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#231) (patch) + +### 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/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#230) (minor) +- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.0`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#300) (major) +- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#122) (patch) + +### 3.0.6 + +_June 1, 2023_ + +- Updated `@csstools/postcss-progressive-custom-properties` to `2.3.0` (minor) + + +### 3.0.5 + +_May 19, 2023_ + +- Updated `@csstools/postcss-progressive-custom-properties` to `2.2.0` (minor) +- Updated `@csstools/css-color-parser` to `1.2.0` (minor) + + + +### 3.0.4 + +_April 17, 2023_ + +- Fix infinite loop when parsing gradient functions. (see : https://github.com/csstools/postcss-plugins/issues/948) + +### 3.0.3 + +_April 10, 2023_ + +- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) +- Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch) +- Updated `@csstools/css-color-parser` to `1.1.2` (patch) + +### 3.0.2 + +_April 10, 2023_ + +- Fix interpolation method `longer`, `increasing`,... for color stops with the same color. + +### 3.0.1 + +_March 28, 2023_ + +- Skip gamut mapping for interpolation color hints. + +### 3.0.0 + +_March 25, 2023_ + +- Handle `color-mix()` internally with `@csstools/css-color-parser` + +### 2.0.1 + +_January 28, 2023_ + +- Improve `types` declaration in `package.json` + +### 2.0.0 + +_January 24, 2023_ + +- Updated: Support for Node v14+ (major). + +### 1.0.1 + +_March 7, 2022_ + +- fix dependencies + +### 1.0.0 + +_March 4, 2022_ + +- Initial version diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/LICENSE.md b/node_modules/@csstools/postcss-gradients-interpolation-method/LICENSE.md new file mode 100644 index 00000000..e8ae93b9 --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/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-gradients-interpolation-method/README.md b/node_modules/@csstools/postcss-gradients-interpolation-method/README.md new file mode 100644 index 00000000..8412d0aa --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/README.md @@ -0,0 +1,169 @@ +# PostCSS Gradients Interpolation Method [PostCSS Logo][PostCSS] + +[npm version][npm-url] [CSS Standard Status][css-url] [Build Status][cli-url] [Discord][discord] + +```bash +npm install @csstools/postcss-gradients-interpolation-method --save-dev +``` + +[PostCSS Gradients Interpolation Method] lets you use different interpolation methods in CSS gradient functions following [CSS Images Module 4]. + +```pcss +.example { + background-image: linear-gradient(in oklch, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%); +} + +:root { + --background-image: linear-gradient(in oklab, hsl(96, 42%, 24%) 0%, hsl(302, 67%, 25%) 100%); +} + +/* becomes */ + +.example { + background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(248, 146, 114), rgb(244, 158, 94), rgb(235, 171, 82), rgb(220, 185, 81), rgb(201, 199, 95), rgb(177, 211, 118), rgb(151, 221, 146), rgb(125, 229, 177), rgb(103, 235, 208), rgb(94, 237, 237) 100%); + background-image: linear-gradient(in oklch, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%); +} + +:root { + --background-image: linear-gradient(rgb(56, 87, 35) 0%, rgb(64, 83, 46), rgb(70, 79, 54), rgb(76, 74, 62), rgb(82, 69, 68), rgb(86, 64, 75), rgb(91, 58, 81), rgb(95, 51, 87), rgb(99, 44, 93), rgb(103, 34, 98), rgb(106, 21, 104) 100%); +} + +@supports (background: linear-gradient(in oklch, red 0%, red 0% 1%, red 2%)) { +:root { + --background-image: linear-gradient(in oklab, hsl(96, 42%, 24%) 0%, hsl(302, 67%, 25%) 100%); +} +} +``` + +## Shortcomings + +⚠️ Color stops with only a color or only an interpolation hint are not supported. + +For best results you should always provide at least the color and position for each color stop. +Double position color stops are supported. + +```pcss +.foo { + /* Only a color: can't transform */ + background-image: linear-gradient(in oklch, black 0%, green, blue 100%); + + /* Only an interpolation hint: can't transform */ + background-image: linear-gradient(in oklch, black 0%, 25%, blue 100%); +} +``` + +⚠️ Variable colors are also not supported. +We can not mix colors when the color is a variable. + +```pcss +.foo { + --red: red; + /* Color stop variable : can't transform */ + background-image: linear-gradient(in oklch, black 0%, var(--red), blue 100%); +} +``` + +## Usage + +Add [PostCSS Gradients Interpolation Method] to your project: + +```bash +npm install postcss @csstools/postcss-gradients-interpolation-method --save-dev +``` + +Use it as a [PostCSS] plugin: + +```js +const postcss = require('postcss'); +const postcssGradientsInterpolationMethod = require('@csstools/postcss-gradients-interpolation-method'); + +postcss([ + postcssGradientsInterpolationMethod(/* pluginOptions */) +]).process(YOUR_CSS /*, processOptions */); +``` + +[PostCSS Gradients Interpolation Method] 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 +postcssGradientsInterpolationMethod({ preserve: false }) +``` + +```pcss +.example { + background-image: linear-gradient(in oklch, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%); +} + +:root { + --background-image: linear-gradient(in oklab, hsl(96, 42%, 24%) 0%, hsl(302, 67%, 25%) 100%); +} + +/* becomes */ + +.example { + background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(248, 146, 114), rgb(244, 158, 94), rgb(235, 171, 82), rgb(220, 185, 81), rgb(201, 199, 95), rgb(177, 211, 118), rgb(151, 221, 146), rgb(125, 229, 177), rgb(103, 235, 208), rgb(94, 237, 237) 100%); +} + +:root { + --background-image: linear-gradient(rgb(56, 87, 35) 0%, rgb(64, 83, 46), rgb(70, 79, 54), rgb(76, 74, 62), rgb(82, 69, 68), rgb(86, 64, 75), rgb(91, 58, 81), rgb(95, 51, 87), rgb(99, 44, 93), rgb(103, 34, 98), rgb(106, 21, 104) 100%); +} +``` + +### enableProgressiveCustomProperties + +The `enableProgressiveCustomProperties` option determines whether the original notation +is wrapped with `@supports` when used in Custom Properties. By default, it is enabled. + +⚠️ We only recommend disabling this when you set `preserve` to `false` or if you bring your own fix for Custom Properties. See what the plugin does in its [README](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties#readme). + +```js +postcssGradientsInterpolationMethod({ enableProgressiveCustomProperties: false }) +``` + +```pcss +.example { + background-image: linear-gradient(in oklch, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%); +} + +:root { + --background-image: linear-gradient(in oklab, hsl(96, 42%, 24%) 0%, hsl(302, 67%, 25%) 100%); +} + +/* becomes */ + +.example { + background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(248, 146, 114), rgb(244, 158, 94), rgb(235, 171, 82), rgb(220, 185, 81), rgb(201, 199, 95), rgb(177, 211, 118), rgb(151, 221, 146), rgb(125, 229, 177), rgb(103, 235, 208), rgb(94, 237, 237) 100%); + background-image: linear-gradient(in oklch, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%); +} + +:root { + --background-image: linear-gradient(rgb(56, 87, 35) 0%, rgb(64, 83, 46), rgb(70, 79, 54), rgb(76, 74, 62), rgb(82, 69, 68), rgb(86, 64, 75), rgb(91, 58, 81), rgb(95, 51, 87), rgb(99, 44, 93), rgb(103, 34, 98), rgb(106, 21, 104) 100%); + --background-image: linear-gradient(in oklab, hsl(96, 42%, 24%) 0%, hsl(302, 67%, 25%) 100%); +} +``` + +_Custom properties do not fallback to the previous declaration_ + +[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test +[css-url]: https://cssdb.org/#gradients-interpolation-method +[discord]: https://discord.gg/bUadyRwkJS +[npm-url]: https://www.npmjs.com/package/@csstools/postcss-gradients-interpolation-method + +[PostCSS]: https://github.com/postcss/postcss +[PostCSS Gradients Interpolation Method]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gradients-interpolation-method +[CSS Images Module 4]: https://drafts.csswg.org/css-images-4/#linear-gradients diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/color-stop-list.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/color-stop-list.d.ts new file mode 100644 index 00000000..4159c39f --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/color-stop-list.d.ts @@ -0,0 +1,9 @@ +import type { ColorData } from '@csstools/css-color-parser'; +import type { ComponentValue } from '@csstools/css-parser-algorithms'; +import { TokenNode } from '@csstools/css-parser-algorithms'; +export type ColorStop = { + color: ComponentValue; + colorData: ColorData; + position: ComponentValue; +}; +export declare function interpolateColorsInColorStopsList(colorStops: Array, colorSpace: TokenNode, hueInterpolationMethod: TokenNode | null, wideGamut?: boolean): Array | false; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-fallback-decl.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-fallback-decl.d.ts new file mode 100644 index 00000000..d7ae8d89 --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-fallback-decl.d.ts @@ -0,0 +1,2 @@ +import type { Declaration } from 'postcss'; +export declare function hasFallback(node: Declaration): boolean; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-supports-at-rule-ancestor.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-supports-at-rule-ancestor.d.ts new file mode 100644 index 00000000..a46009ec --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-supports-at-rule-ancestor.d.ts @@ -0,0 +1,2 @@ +import type { Node } from 'postcss'; +export declare function hasSupportsAtRuleAncestor(node: Node): boolean; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.cjs b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.cjs new file mode 100644 index 00000000..3ab3f55e --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.cjs @@ -0,0 +1 @@ +"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),o=require("@csstools/css-parser-algorithms"),t=require("@csstools/css-tokenizer"),n=require("@csstools/css-color-parser");const i=/(repeating-)?(linear|radial|conic)-gradient\(.*?in/i,s=/^(repeating-)?(linear|radial|conic)-gradient$/i;function hasFallback(e){const o=e.parent;if(!o)return!1;const t=e.prop.toLowerCase(),n=o.index(e);for(let e=0;e0&&N.some((e=>!o.isCommentNode(e)))&&N.push(new o.TokenNode([t.TokenType.Comma,",",-1,-1,void 0]),new o.WhitespaceNode([[t.TokenType.Whitespace," ",-1,-1,void 0]])),trim([...N,...trim(g)])}function trim(e){let t=0,n=e.length-1;for(let n=0;n=0;t--)if(!o.isWhitespaceNode(e[t])){n=t;break}return e.slice(t,n+1)}const basePlugin=e=>({postcssPlugin:"postcss-gradients-interpolation-method",Declaration(n){if(!i.test(n.value))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;const s=t.tokenize({css:n.value}),r=o.stringify(o.replaceComponentValues(o.parseCommaSeparatedListOfComponentValues(s),(e=>{if(!o.isFunctionNode(e))return;const t=modifyGradientFunctionComponentValues(e);t&&(e.value=t)})));if(r===n.value)return;const a=o.stringify(o.replaceComponentValues(o.parseCommaSeparatedListOfComponentValues(s),(e=>{if(!o.isFunctionNode(e))return;const t=modifyGradientFunctionComponentValues(e,!0);t&&(e.value=t)})));n.cloneBefore({value:r}),r!==a&&n.cloneBefore({value:a}),null!=e&&e.preserve||n.remove()}});basePlugin.postcss=!0;const postcssPlugin=o=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},o);return t.enableProgressiveCustomProperties?{postcssPlugin:"postcss-gradients-interpolation-method",plugins:[e(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.d.ts new file mode 100644 index 00000000..0520e965 --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.d.ts @@ -0,0 +1,10 @@ +import type { PluginCreator } from 'postcss'; +/** postcss-gradients-interpolation-method plugin options */ +export type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; +}; +declare const postcssPlugin: PluginCreator; +export default postcssPlugin; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.mjs b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.mjs new file mode 100644 index 00000000..392d72e1 --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.mjs @@ -0,0 +1 @@ +import o from"@csstools/postcss-progressive-custom-properties";import{WhitespaceNode as e,TokenNode as t,FunctionNode as r,isCommentNode as n,isWhitespaceNode as i,isTokenNode as s,stringify as l,replaceComponentValues as a,parseCommaSeparatedListOfComponentValues as c,isFunctionNode as u}from"@csstools/css-parser-algorithms";import{TokenType as p,tokenize as f}from"@csstools/css-tokenizer";import{serializeP3 as v,color as h,colorDataFitsRGB_Gamut as d,serializeRGB as m}from"@csstools/css-color-parser";const g=/(repeating-)?(linear|radial|conic)-gradient\(.*?in/i,w=/^(repeating-)?(linear|radial|conic)-gradient$/i;function hasFallback(o){const e=o.parent;if(!e)return!1;const t=o.prop.toLowerCase(),r=e.index(o);for(let o=0;o0&&S.some((o=>!n(o)))&&S.push(new t([p.Comma,",",-1,-1,void 0]),new e([[p.Whitespace," ",-1,-1,void 0]])),trim([...S,...trim(g)])}function trim(o){let e=0,t=o.length-1;for(let t=0;t=0;e--)if(!i(o[e])){t=e;break}return o.slice(e,t+1)}const basePlugin=o=>({postcssPlugin:"postcss-gradients-interpolation-method",Declaration(e){if(!g.test(e.value))return;if(hasFallback(e))return;if(hasSupportsAtRuleAncestor(e))return;const t=f({css:e.value}),r=l(a(c(t),(o=>{if(!u(o))return;const e=modifyGradientFunctionComponentValues(o);e&&(o.value=e)})));if(r===e.value)return;const n=l(a(c(t),(o=>{if(!u(o))return;const e=modifyGradientFunctionComponentValues(o,!0);e&&(o.value=e)})));e.cloneBefore({value:r}),r!==n&&e.cloneBefore({value:n}),null!=o&&o.preserve||e.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},e);return t.enableProgressiveCustomProperties?{postcssPlugin:"postcss-gradients-interpolation-method",plugins:[o(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/is-gradient.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/is-gradient.d.ts new file mode 100644 index 00000000..2d83e89e --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/is-gradient.d.ts @@ -0,0 +1,2 @@ +export declare const gradientFunctionRegex: RegExp; +export declare const gradientNameRegex: RegExp; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/modify-gradient-component-values.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/modify-gradient-component-values.d.ts new file mode 100644 index 00000000..6917beda --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/modify-gradient-component-values.d.ts @@ -0,0 +1,2 @@ +import type { ComponentValue, FunctionNode } from '@csstools/css-parser-algorithms'; +export declare function modifyGradientFunctionComponentValues(gradientFunction: FunctionNode, wideGamut?: boolean): Array | false; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/parse-color-stops.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/parse-color-stops.d.ts new file mode 100644 index 00000000..0342da5c --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/parse-color-stops.d.ts @@ -0,0 +1,3 @@ +import type { ColorStop } from './color-stop-list'; +import type { ComponentValue } from '@csstools/css-parser-algorithms'; +export declare function parseColorStops(componentValues: Array): Array | false; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/package.json b/node_modules/@csstools/postcss-gradients-interpolation-method/package.json new file mode 100644 index 00000000..b6fdb43e --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/package.json @@ -0,0 +1,88 @@ +{ + "name": "@csstools/postcss-gradients-interpolation-method", + "description": "Use interpolation methods in CSS gradient functions", + "version": "4.0.7", + "author": "Jonathan Neal ", + "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/css-color-parser": "^1.4.0", + "@csstools/css-parser-algorithms": "^2.3.2", + "@csstools/css-tokenizer": "^2.2.1", + "@csstools/postcss-progressive-custom-properties": "^3.0.2" + }, + "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-gradients-interpolation-method#readme", + "repository": { + "type": "git", + "url": "https://github.com/csstools/postcss-plugins.git", + "directory": "plugins/postcss-gradients-interpolation-method" + }, + "bugs": "https://github.com/csstools/postcss-plugins/issues", + "keywords": [ + "color", + "color space interpolation", + "conic", + "css", + "gradients", + "hue interpolation method", + "interpolation", + "linear", + "postcss", + "postcss-plugin", + "radial", + "repeating", + "syntax" + ], + "csstools": { + "cssdbId": "gradients-interpolation-method", + "exportName": "postcssGradientsInterpolationMethod", + "humanReadableName": "PostCSS Gradients Interpolation Method", + "specUrl": "https://drafts.csswg.org/css-images-4/#linear-gradients" + }, + "volta": { + "extends": "../../package.json" + } +} -- cgit v1.2.3