Initial upload
This commit is contained in:
9
node_modules/@csstools/color-helpers/CHANGELOG.md
generated
vendored
Normal file
9
node_modules/@csstools/color-helpers/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# Changes to Color Helpers
|
||||
|
||||
### 6.1.1
|
||||
|
||||
_August 15, 2026_
|
||||
|
||||
- Updated: gamut mapping algorithm
|
||||
|
||||
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md)
|
||||
18
node_modules/@csstools/color-helpers/LICENSE.md
generated
vendored
Normal file
18
node_modules/@csstools/color-helpers/LICENSE.md
generated
vendored
Normal file
@@ -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.
|
||||
32
node_modules/@csstools/color-helpers/README.md
generated
vendored
Normal file
32
node_modules/@csstools/color-helpers/README.md
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Color Helpers <img src="https://cssdb.org/images/css.svg" alt="for CSS" width="90" height="90" align="right">
|
||||
|
||||
[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/color-helpers.svg" height="20">][npm-url]
|
||||
[<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/actions/workflows/test.yml/badge.svg?branch=main" height="20">][cli-url]
|
||||
[<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
|
||||
|
||||
## Usage
|
||||
|
||||
Add [Color Helpers] to your project:
|
||||
|
||||
```bash
|
||||
npm install @csstools/color-helpers --save-dev
|
||||
```
|
||||
|
||||
This package exists to join all the different color functions scattered among the Colors 4 and Colors 5 plugins we maintain such as:
|
||||
|
||||
* [PostCSS Color Function]
|
||||
* [PostCSS Lab Function]
|
||||
* [PostCSS OKLab Function]
|
||||
|
||||
## Copyright
|
||||
|
||||
This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/tree/main/css-color-4. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
|
||||
|
||||
[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
|
||||
[discord]: https://discord.gg/bUadyRwkJS
|
||||
[npm-url]: https://www.npmjs.com/package/@csstools/color-helpers
|
||||
|
||||
[Color Helpers]: https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers
|
||||
[PostCSS Color Function]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-function
|
||||
[PostCSS Lab Function]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-lab-functionw
|
||||
[PostCSS OKLab Function]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-oklab-function
|
||||
711
node_modules/@csstools/color-helpers/dist/index.d.ts
generated
vendored
Normal file
711
node_modules/@csstools/color-helpers/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,711 @@
|
||||
/**
|
||||
* @param {Color} color [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function a98_RGB_to_XYZ_D50(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function a98_RGB_to_XYZ_D65(x: Color): Color;
|
||||
|
||||
export declare function clip(color: Color): Color;
|
||||
|
||||
export declare type Color = [number, number, number];
|
||||
|
||||
/**
|
||||
* WCAG 2.1 contrast ratio
|
||||
*/
|
||||
export declare function contrast_ratio_wcag_2_1(color1: Color, color2: Color): number;
|
||||
|
||||
/**
|
||||
* Convert an array of linear-light display-p3 RGB in the range 0.0-1.0
|
||||
* to gamma corrected form
|
||||
*
|
||||
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
||||
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
|
||||
*/
|
||||
export declare function gam_P3(RGB: Color): Color;
|
||||
|
||||
/**
|
||||
* Convert an array of linear-light sRGB values in the range 0.0-1.0 to gamma corrected form
|
||||
* Extended transfer function:
|
||||
* For negative values, linear portion extends on reflection
|
||||
* of axis, then uses reflected pow below that
|
||||
*
|
||||
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
||||
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
|
||||
* @see https://en.wikipedia.org/wiki/SRGB
|
||||
*/
|
||||
export declare function gam_sRGB(RGB: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [h, s, l]
|
||||
* - Hue as degrees 0..360;
|
||||
* - Saturation as number 0..100;
|
||||
* - Lightness as number 0..100;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function HSL_to_XYZ_D50(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [h, s, l]
|
||||
* - Hue as degrees 0..360;
|
||||
* - Saturation as number 0..100;
|
||||
* - Lightness as number 0..100;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function HSL_to_XYZ_D65(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [h, w, b]
|
||||
* - Hue as degrees 0..360;
|
||||
* - Whiteness as number 0..100;
|
||||
* - Blackness as number 0..100;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function HWB_to_XYZ_D50(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [h, w, b]
|
||||
* - Hue as degrees 0..360;
|
||||
* - Whiteness as number 0..100;
|
||||
* - Blackness as number 0..100;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function HWB_to_XYZ_D65(x: Color): Color;
|
||||
|
||||
export declare function inGamut(x: Color): boolean;
|
||||
|
||||
/**
|
||||
* @param {Color} color [l, a, b]
|
||||
* - Lightness as number 0..100;
|
||||
* - a as number -160..160;
|
||||
* - b as number -160..160;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function Lab_to_XYZ_D50(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [l, a, b]
|
||||
* - Lightness as number 0..100;
|
||||
* - a as number -160..160;
|
||||
* - b as number -160..160;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function Lab_to_XYZ_D65(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [l, c, h]
|
||||
* - Lightness as number 0..100;
|
||||
* - Chroma as number 0..230;
|
||||
* - Hue as degrees 0..360;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function LCH_to_XYZ_D50(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [l, c, h]
|
||||
* - Lightness as number 0..100;
|
||||
* - Chroma as number 0..230;
|
||||
* - Hue as degrees 0..360;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function LCH_to_XYZ_D65(x: Color): Color;
|
||||
|
||||
/**
|
||||
* Convert an array of display-p3 RGB values in the range 0.0 - 1.0
|
||||
* to linear light (un-companded) form.
|
||||
*
|
||||
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
||||
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
|
||||
*/
|
||||
export declare function lin_P3(RGB: Color): Color;
|
||||
|
||||
/**
|
||||
* Convert an array of linear-light display-p3 values to CIE XYZ
|
||||
* using D65 (no chromatic adaptation)
|
||||
*
|
||||
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
||||
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
|
||||
* @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
|
||||
*/
|
||||
export declare function lin_P3_to_XYZ(rgb: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function lin_P3_to_XYZ_D50(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function lin_P3_to_XYZ_D65(x: Color): Color;
|
||||
|
||||
/**
|
||||
* Convert an array of of sRGB values where in-gamut values are in the range
|
||||
* [0 - 1] to linear light (un-companded) form.
|
||||
* Extended transfer function:
|
||||
* For negative values, linear portion is extended on reflection of axis,
|
||||
* then reflected power function is used.
|
||||
*
|
||||
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
||||
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
|
||||
* @see https://en.wikipedia.org/wiki/SRGB
|
||||
*/
|
||||
export declare function lin_sRGB(RGB: Color): Color;
|
||||
|
||||
/**
|
||||
* Convert an array of linear-light sRGB values to CIE XYZ
|
||||
* using sRGB's own white, D65 (no chromatic adaptation)
|
||||
*
|
||||
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
||||
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
|
||||
*/
|
||||
export declare function lin_sRGB_to_XYZ(rgb: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function lin_sRGB_to_XYZ_D50(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function lin_sRGB_to_XYZ_D65(x: Color): Color;
|
||||
|
||||
export declare function mapGamut(startOKLCH: Color, toDestination: (x: Color) => Color, fromDestination: (x: Color) => Color): Color;
|
||||
|
||||
/**
|
||||
* @license MIT https://github.com/facelessuser/coloraide/blob/main/LICENSE.md
|
||||
*/
|
||||
export declare function mapGamutRayTrace(startOKLCH: Color, toLinear: (x: Color) => Color, fromLinear: (x: Color) => Color): Color;
|
||||
|
||||
export declare const namedColors: Record<string, Color>;
|
||||
|
||||
/**
|
||||
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
||||
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
|
||||
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js
|
||||
*/
|
||||
export declare function OKLab_to_OKLCH(OKLab: Color): Color;
|
||||
|
||||
/**
|
||||
* Given OKLab, convert to XYZ relative to D65
|
||||
*
|
||||
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
||||
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
|
||||
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js
|
||||
*/
|
||||
export declare function OKLab_to_XYZ(OKLab: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [l, a, b]
|
||||
* - Lightness as number 0..1;
|
||||
* - a as number 0..0.5;
|
||||
* - b as number 0..0.5;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function OKLab_to_XYZ_D50(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [l, a, b]
|
||||
* - Lightness as number 0..1;
|
||||
* - a as number 0..0.5;
|
||||
* - b as number 0..0.5;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function OKLab_to_XYZ_D65(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
||||
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
|
||||
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js
|
||||
*/
|
||||
export declare function OKLCH_to_OKLab(OKLCH: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [l, c, h]
|
||||
* - Lightness as number 0..1;
|
||||
* - Chroma as number 0..0.5;
|
||||
* - Hue as degrees 0..360;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function OKLCH_to_XYZ_D50(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [l, c, h]
|
||||
* - Lightness as number 0..1;
|
||||
* - Chroma as number 0..0.5;
|
||||
* - Hue as degrees 0..360;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function OKLCH_to_XYZ_D65(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function P3_to_XYZ_D50(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function P3_to_XYZ_D65(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function ProPhoto_RGB_to_XYZ_D50(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function ProPhoto_RGB_to_XYZ_D65(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function rec_2020_to_XYZ_D50(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function rec_2020_to_XYZ_D65(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function sRGB_to_XYZ_D50(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function sRGB_to_XYZ_D65(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} a98 sRGB [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
*/
|
||||
export declare function XYZ_D50_to_a98_RGB(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} HSL [r, g, b]
|
||||
* - Hue as degrees 0..360;
|
||||
* - Saturation as number 0..100;
|
||||
* - Lightness as number 0..100;
|
||||
*/
|
||||
export declare function XYZ_D50_to_HSL(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} HWB [r, g, b]
|
||||
* - Hue as degrees 0..360;
|
||||
* - Whiteness as number 0..100;
|
||||
* - Blackness as number 0..100;
|
||||
*/
|
||||
export declare function XYZ_D50_to_HWB(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} Lab [r, g, b]
|
||||
* - Lightness as number 0..100;
|
||||
* - a as number -160..160;
|
||||
* - b as number -160..160;
|
||||
*/
|
||||
export declare function XYZ_D50_to_Lab(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} LCH [r, g, b]
|
||||
* - Lightness as number 0..100;
|
||||
* - Chroma as number 0..230;
|
||||
* - Hue as degrees 0..360;
|
||||
*/
|
||||
export declare function XYZ_D50_to_LCH(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} P3 [r, g, b]
|
||||
* - R as number 0..1;
|
||||
* - G as number 0..1;
|
||||
* - B as number 0..1;
|
||||
*/
|
||||
export declare function XYZ_D50_to_lin_P3(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} linear sRGB [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
*/
|
||||
export declare function XYZ_D50_to_lin_sRGB(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} OKLab [r, g, b]
|
||||
* - Lightness as number 0..1;
|
||||
* - a as number 0..0.5;
|
||||
* - b as number 0..0.5;
|
||||
*/
|
||||
export declare function XYZ_D50_to_OKLab(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} OKLCH [r, g, b]
|
||||
* - Lightness as number 0..1;
|
||||
* - Chroma as number 0..0.5;
|
||||
* - Hue as degrees 0..360;
|
||||
*/
|
||||
export declare function XYZ_D50_to_OKLCH(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} P3 [r, g, b]
|
||||
* - R as number 0..1;
|
||||
* - G as number 0..1;
|
||||
* - B as number 0..1;
|
||||
*/
|
||||
export declare function XYZ_D50_to_P3(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} ProPhoto [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
*/
|
||||
export declare function XYZ_D50_to_ProPhoto(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} rec 2020 [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
*/
|
||||
export declare function XYZ_D50_to_rec_2020(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} sRGB [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
*/
|
||||
export declare function XYZ_D50_to_sRGB(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function XYZ_D50_to_XYZ_D50(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} D65 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function XYZ_D50_to_XYZ_D65(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} a98 sRGB [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
*/
|
||||
export declare function XYZ_D65_to_a98_RGB(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} HSL [r, g, b]
|
||||
* - Hue as degrees 0..360;
|
||||
* - Saturation as number 0..100;
|
||||
* - Lightness as number 0..100;
|
||||
*/
|
||||
export declare function XYZ_D65_to_HSL(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} HWB [r, g, b]
|
||||
* - Hue as degrees 0..360;
|
||||
* - Whiteness as number 0..100;
|
||||
* - Blackness as number 0..100;
|
||||
*/
|
||||
export declare function XYZ_D65_to_HWB(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} Lab [r, g, b]
|
||||
* - Lightness as number 0..100;
|
||||
* - a as number -160..160;
|
||||
* - b as number -160..160;
|
||||
*/
|
||||
export declare function XYZ_D65_to_Lab(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} LCH [r, g, b]
|
||||
* - Lightness as number 0..100;
|
||||
* - Chroma as number 0..230;
|
||||
* - Hue as degrees 0..360;
|
||||
*/
|
||||
export declare function XYZ_D65_to_LCH(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} P3 [r, g, b]
|
||||
* - R as number 0..1;
|
||||
* - G as number 0..1;
|
||||
* - B as number 0..1;
|
||||
*/
|
||||
export declare function XYZ_D65_to_lin_P3(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} linear sRGB [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
*/
|
||||
export declare function XYZ_D65_to_lin_sRGB(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} OKLab [r, g, b]
|
||||
* - Lightness as number 0..1;
|
||||
* - a as number 0..0.5;
|
||||
* - b as number 0..0.5;
|
||||
*/
|
||||
export declare function XYZ_D65_to_OKLab(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} OKLCH [r, g, b]
|
||||
* - Lightness as number 0..1;
|
||||
* - Chroma as number 0..0.5;
|
||||
* - Hue as degrees 0..360;
|
||||
*/
|
||||
export declare function XYZ_D65_to_OKLCH(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} P3 [r, g, b]
|
||||
* - R as number 0..1;
|
||||
* - G as number 0..1;
|
||||
* - B as number 0..1;
|
||||
*/
|
||||
export declare function XYZ_D65_to_P3(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} ProPhoto [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
*/
|
||||
export declare function XYZ_D65_to_ProPhoto(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} rec 2020 [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
*/
|
||||
export declare function XYZ_D65_to_rec_2020(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} sRGB [r, g, b]
|
||||
* - Red as number 0..1;
|
||||
* - Green as number 0..1;
|
||||
* - Blue as number 0..1;
|
||||
*/
|
||||
export declare function XYZ_D65_to_sRGB(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function XYZ_D65_to_XYZ_D50(x: Color): Color;
|
||||
|
||||
/**
|
||||
* @param {Color} color [x, y, z]
|
||||
* - X as number 0..1;
|
||||
* - Y as number 0..1;
|
||||
* - Z as number 0..1;
|
||||
* @return {Color} D50 XYZ [x, y, z]
|
||||
*/
|
||||
export declare function XYZ_D65_to_XYZ_D65(x: Color): Color;
|
||||
|
||||
/**
|
||||
* Convert XYZ to linear-light P3
|
||||
*
|
||||
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
||||
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
|
||||
*/
|
||||
export declare function XYZ_to_lin_P3(XYZ: Color): Color;
|
||||
|
||||
/**
|
||||
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
||||
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
|
||||
*/
|
||||
export declare function XYZ_to_lin_sRGB(XYZ: Color): Color;
|
||||
|
||||
/**
|
||||
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
||||
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
|
||||
*
|
||||
* XYZ <-> LMS matrices recalculated for consistent reference white
|
||||
* @see https://github.com/w3c/csswg-drafts/issues/6642#issuecomment-943521484
|
||||
*/
|
||||
export declare function XYZ_to_OKLab(XYZ: Color): Color;
|
||||
|
||||
export { }
|
||||
261
node_modules/@csstools/color-helpers/dist/index.mjs
generated
vendored
Normal file
261
node_modules/@csstools/color-helpers/dist/index.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
55
node_modules/@csstools/color-helpers/package.json
generated
vendored
Normal file
55
node_modules/@csstools/color-helpers/package.json
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"name": "@csstools/color-helpers",
|
||||
"description": "Color helpers to ease transformation between formats, gamut, etc",
|
||||
"version": "6.1.1",
|
||||
"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": ">=20.19.0"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.mjs"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"CHANGELOG.md",
|
||||
"LICENSE.md",
|
||||
"README.md",
|
||||
"dist"
|
||||
],
|
||||
"scripts": {},
|
||||
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/csstools/postcss-plugins.git",
|
||||
"directory": "packages/color-helpers"
|
||||
},
|
||||
"bugs": "https://github.com/csstools/postcss-plugins/issues",
|
||||
"keywords": [
|
||||
"colors",
|
||||
"css"
|
||||
]
|
||||
}
|
||||
10
node_modules/@csstools/css-calc/CHANGELOG.md
generated
vendored
Normal file
10
node_modules/@csstools/css-calc/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# Changes to CSS Calc
|
||||
|
||||
### 3.3.0
|
||||
|
||||
_July 22, 2026_
|
||||
|
||||
- Add support for `calc-mix()`
|
||||
- Update `random()` to match the latest spec
|
||||
|
||||
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md)
|
||||
20
node_modules/@csstools/css-calc/LICENSE.md
generated
vendored
Normal file
20
node_modules/@csstools/css-calc/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2022 Romain Menke, Antonio Laguna <antonio@laguna.es>
|
||||
|
||||
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.
|
||||
132
node_modules/@csstools/css-calc/README.md
generated
vendored
Normal file
132
node_modules/@csstools/css-calc/README.md
generated
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
# CSS Calc <img src="https://cssdb.org/images/css.svg" alt="for CSS" width="90" height="90" align="right">
|
||||
|
||||
[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/css-calc.svg" height="20">][npm-url]
|
||||
[<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/actions/workflows/test.yml/badge.svg?branch=main" height="20">][cli-url]
|
||||
[<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
|
||||
|
||||
Implemented from : https://drafts.csswg.org/css-values-4/ on 2023-02-17
|
||||
|
||||
## Usage
|
||||
|
||||
Add [CSS calc] to your project:
|
||||
|
||||
```bash
|
||||
npm install @csstools/css-calc @csstools/css-parser-algorithms @csstools/css-tokenizer --save-dev
|
||||
```
|
||||
|
||||
### With string values :
|
||||
|
||||
```mjs
|
||||
import { calc } from '@csstools/css-calc';
|
||||
|
||||
// '20'
|
||||
console.log(calc('calc(10 * 2)'));
|
||||
```
|
||||
|
||||
### With component values :
|
||||
|
||||
```mjs
|
||||
import { stringify, tokenizer } from '@csstools/css-tokenizer';
|
||||
import { parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser-algorithms';
|
||||
import { calcFromComponentValues } from '@csstools/css-calc';
|
||||
|
||||
const t = tokenizer({
|
||||
css: 'calc(10 * 2)',
|
||||
});
|
||||
|
||||
const tokens = [];
|
||||
|
||||
{
|
||||
while (!t.endOfFile()) {
|
||||
tokens.push(t.nextToken());
|
||||
}
|
||||
|
||||
tokens.push(t.nextToken()); // EOF-token
|
||||
}
|
||||
|
||||
const result = parseCommaSeparatedListOfComponentValues(tokens, {});
|
||||
|
||||
// filter or mutate the component values
|
||||
|
||||
const calcResult = calcFromComponentValues(result, { precision: 5, toCanonicalUnits: true });
|
||||
|
||||
// filter or mutate the component values even further
|
||||
|
||||
const calcResultStr = calcResult.map((componentValues) => {
|
||||
return componentValues.map((x) => stringify(...x.tokens())).join('');
|
||||
}).join(',');
|
||||
|
||||
// '20'
|
||||
console.log(calcResultStr);
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
#### `precision` :
|
||||
|
||||
The default precision is fairly high.
|
||||
It aims to be high enough to make rounding unnoticeable in the browser.
|
||||
|
||||
You can set it to a lower number to suit your needs.
|
||||
|
||||
```mjs
|
||||
import { calc } from '@csstools/css-calc';
|
||||
|
||||
// '0.3'
|
||||
console.log(calc('calc(1 / 3)', { precision: 1 }));
|
||||
// '0.33'
|
||||
console.log(calc('calc(1 / 3)', { precision: 2 }));
|
||||
```
|
||||
|
||||
#### `globals` :
|
||||
|
||||
Pass global values as a map of key value pairs.
|
||||
|
||||
> Example : Relative color syntax (`lch(from pink calc(l / 2) c h)`) exposes color channel information as ident tokens.
|
||||
> By passing globals for `l`, `c` and `h` it is possible to solve nested `calc()`'s.
|
||||
|
||||
```mjs
|
||||
import { calc } from '@csstools/css-calc';
|
||||
|
||||
const globals = new Map([
|
||||
['a', '10px'],
|
||||
['b', '2rem'],
|
||||
]);
|
||||
|
||||
// '20px'
|
||||
console.log(calc('calc(a * 2)', { globals: globals }));
|
||||
// '6rem'
|
||||
console.log(calc('calc(b * 3)', { globals: globals }));
|
||||
```
|
||||
|
||||
#### `toCanonicalUnits` :
|
||||
|
||||
By default this package will try to preserve units.
|
||||
The heuristic to do this is very simplistic.
|
||||
We take the first unit we encounter and try to convert other dimensions to that unit.
|
||||
|
||||
This better matches what users expect from a CSS dev tool.
|
||||
|
||||
If you want to have outputs that are closes to CSS serialized values you can pass `toCanonicalUnits: true`.
|
||||
|
||||
```mjs
|
||||
import { calc } from '@csstools/css-calc';
|
||||
|
||||
// '20hz'
|
||||
console.log(calc('calc(0.01khz + 10hz)', { toCanonicalUnits: true }));
|
||||
|
||||
// '20hz'
|
||||
console.log(calc('calc(10hz + 0.01khz)', { toCanonicalUnits: true }));
|
||||
|
||||
// '0.02khz' !!!
|
||||
console.log(calc('calc(0.01khz + 10hz)', { toCanonicalUnits: false }));
|
||||
|
||||
// '20hz'
|
||||
console.log(calc('calc(10hz + 0.01khz)', { toCanonicalUnits: false }));
|
||||
```
|
||||
|
||||
[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
|
||||
[discord]: https://discord.gg/bUadyRwkJS
|
||||
[npm-url]: https://www.npmjs.com/package/@csstools/css-calc
|
||||
|
||||
[CSS calc]: https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc
|
||||
106
node_modules/@csstools/css-calc/dist/index.d.ts
generated
vendored
Normal file
106
node_modules/@csstools/css-calc/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
import { ComponentValue } from '@csstools/css-parser-algorithms';
|
||||
import type { TokenDimension } from '@csstools/css-tokenizer';
|
||||
import type { TokenNumber } from '@csstools/css-tokenizer';
|
||||
import type { TokenPercentage } from '@csstools/css-tokenizer';
|
||||
|
||||
export declare function calc(css: string, options?: conversionOptions): string;
|
||||
|
||||
export declare function calcFromComponentValues(componentValuesList: Array<Array<ComponentValue>>, options?: conversionOptions): Array<Array<ComponentValue>>;
|
||||
|
||||
export declare type conversionOptions = {
|
||||
/**
|
||||
* If a calc expression can not be solved the parse error might be reported through this callback.
|
||||
* Not all cases are covered. Open an issue if you need specific errors reported.
|
||||
*
|
||||
* Values are recursively visited and at each nesting level an attempt is made to solve the expression.
|
||||
* Errors can be reported multiple times as a result of this.
|
||||
*/
|
||||
onParseError?: (error: ParseError) => void;
|
||||
/**
|
||||
* Pass global values as a map of key value pairs.
|
||||
*/
|
||||
globals?: GlobalsWithStrings;
|
||||
/**
|
||||
* The default precision is fairly high.
|
||||
* It aims to be high enough to make rounding unnoticeable in the browser.
|
||||
* You can set it to a lower number to suite your needs.
|
||||
*/
|
||||
precision?: number;
|
||||
/**
|
||||
* The CSS pixel length of one device pixel.
|
||||
* Used when rounding to `line-width` and similar features
|
||||
*/
|
||||
devicePixelLength?: number;
|
||||
/**
|
||||
* By default this package will try to preserve units.
|
||||
* The heuristic to do this is very simplistic.
|
||||
* We take the first unit we encounter and try to convert other dimensions to that unit.
|
||||
*
|
||||
* This better matches what users expect from a CSS dev tool.
|
||||
*
|
||||
* If you want to have outputs that are closes to CSS serialized values you can set `true`.
|
||||
*/
|
||||
toCanonicalUnits?: boolean;
|
||||
/**
|
||||
* Convert NaN, Infinity, ... into standard representable values.
|
||||
*/
|
||||
censorIntoStandardRepresentableValues?: boolean;
|
||||
/**
|
||||
* Some percentages resolve against other values and might be negative or positive depending on context.
|
||||
* Raw percentages are more likely to be safe to simplify outside of a browser context
|
||||
*
|
||||
* @see https://drafts.csswg.org/css-values-4/#calc-simplification
|
||||
*/
|
||||
rawPercentages?: boolean;
|
||||
/**
|
||||
* The values used to generate random value cache keys.
|
||||
*/
|
||||
randomCaching?: {
|
||||
/**
|
||||
* The name of the property the random function is used in.
|
||||
*/
|
||||
propertyName: string;
|
||||
/**
|
||||
* N is the index of the random function among other random functions in the same property value.
|
||||
*/
|
||||
propertyN: number;
|
||||
/**
|
||||
* An element ID identifying the element the style is being applied to.
|
||||
* When omitted any `random()` call will not be computed.
|
||||
*/
|
||||
elementID: string;
|
||||
/**
|
||||
* A document ID identifying the Document the styles are from.
|
||||
* When omitted any `random()` call will not be computed.
|
||||
*/
|
||||
documentID: string;
|
||||
};
|
||||
};
|
||||
|
||||
export declare type GlobalsWithStrings = Map<string, TokenDimension | TokenNumber | TokenPercentage | string>;
|
||||
|
||||
export declare const mathFunctionNames: Set<string>;
|
||||
|
||||
/**
|
||||
* Any errors are reported through the `onParseError` callback.
|
||||
*/
|
||||
export declare class ParseError extends Error {
|
||||
/** The index of the start character of the current token. */
|
||||
sourceStart: number;
|
||||
/** The index of the end character of the current token. */
|
||||
sourceEnd: number;
|
||||
constructor(message: string, sourceStart: number, sourceEnd: number);
|
||||
}
|
||||
|
||||
export declare const ParseErrorMessage: {
|
||||
UnexpectedAdditionOfDimensionOrPercentageWithNumber: string;
|
||||
UnexpectedSubtractionOfDimensionOrPercentageWithNumber: string;
|
||||
};
|
||||
|
||||
export declare class ParseErrorWithComponentValues extends ParseError {
|
||||
/** The associated component values. */
|
||||
componentValues: Array<ComponentValue>;
|
||||
constructor(message: string, componentValues: Array<ComponentValue>);
|
||||
}
|
||||
|
||||
export { }
|
||||
1
node_modules/@csstools/css-calc/dist/index.mjs
generated
vendored
Normal file
1
node_modules/@csstools/css-calc/dist/index.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
59
node_modules/@csstools/css-calc/package.json
generated
vendored
Normal file
59
node_modules/@csstools/css-calc/package.json
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"name": "@csstools/css-calc",
|
||||
"description": "Solve CSS math expressions",
|
||||
"version": "3.3.0",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Antonio Laguna",
|
||||
"email": "antonio@laguna.es",
|
||||
"url": "https://antonio.laguna.es"
|
||||
},
|
||||
{
|
||||
"name": "Romain Menke",
|
||||
"email": "romainmenke@gmail.com"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/csstools"
|
||||
},
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/csstools"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.19.0"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.mjs"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"CHANGELOG.md",
|
||||
"LICENSE.md",
|
||||
"README.md",
|
||||
"dist"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"@csstools/css-parser-algorithms": "^4.0.0",
|
||||
"@csstools/css-tokenizer": "^4.0.0"
|
||||
},
|
||||
"scripts": {},
|
||||
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/csstools/postcss-plugins.git",
|
||||
"directory": "packages/css-calc"
|
||||
},
|
||||
"bugs": "https://github.com/csstools/postcss-plugins/issues",
|
||||
"keywords": [
|
||||
"calc",
|
||||
"css"
|
||||
]
|
||||
}
|
||||
11
node_modules/@csstools/css-color-parser/CHANGELOG.md
generated
vendored
Normal file
11
node_modules/@csstools/css-color-parser/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# Changes to CSS Color Parser
|
||||
|
||||
### 4.2.0
|
||||
|
||||
_August 15, 2026_
|
||||
|
||||
- Add `computedValue()` serialization function for color data.
|
||||
- Mandatory `alpha` in the relative `alpha()` function.
|
||||
- Updated [`@csstools/color-helpers`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers) to [`6.1.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md#611) (patch)
|
||||
|
||||
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md)
|
||||
20
node_modules/@csstools/css-color-parser/LICENSE.md
generated
vendored
Normal file
20
node_modules/@csstools/css-color-parser/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2022 Romain Menke, Antonio Laguna <antonio@laguna.es>
|
||||
|
||||
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.
|
||||
37
node_modules/@csstools/css-color-parser/README.md
generated
vendored
Normal file
37
node_modules/@csstools/css-color-parser/README.md
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
# CSS Color Parser <img src="https://cssdb.org/images/css.svg" alt="for CSS" width="90" height="90" align="right">
|
||||
|
||||
[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/css-color-parser.svg" height="20">][npm-url]
|
||||
[<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/actions/workflows/test.yml/badge.svg?branch=main" height="20">][cli-url]
|
||||
[<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
|
||||
|
||||
## Usage
|
||||
|
||||
Add [CSS Color Parser] to your project:
|
||||
|
||||
```bash
|
||||
npm install @csstools/css-color-parser @csstools/css-parser-algorithms @csstools/css-tokenizer --save-dev
|
||||
```
|
||||
|
||||
```ts
|
||||
import { color } from '@csstools/css-color-parser';
|
||||
import { isFunctionNode, parseComponentValue } from '@csstools/css-parser-algorithms';
|
||||
import { serializeRGB } from '@csstools/css-color-parser';
|
||||
import { tokenize } from '@csstools/css-tokenizer';
|
||||
|
||||
// color() expects a parsed component value.
|
||||
const hwbComponentValue = parseComponentValue(tokenize({ css: 'hwb(10deg 10% 20%)' }));
|
||||
const colorData = color(hwbComponentValue);
|
||||
if (colorData) {
|
||||
console.log(colorData);
|
||||
|
||||
// serializeRGB() returns a component value.
|
||||
const rgbComponentValue = serializeRGB(colorData);
|
||||
console.log(rgbComponentValue.toString());
|
||||
}
|
||||
```
|
||||
|
||||
[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
|
||||
[discord]: https://discord.gg/bUadyRwkJS
|
||||
[npm-url]: https://www.npmjs.com/package/@csstools/css-color-parser
|
||||
|
||||
[CSS Color Parser]: https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser
|
||||
170
node_modules/@csstools/css-color-parser/dist/index.d.ts
generated
vendored
Normal file
170
node_modules/@csstools/css-color-parser/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,170 @@
|
||||
import type { Color } from '@csstools/color-helpers';
|
||||
import type { ComponentValue } from '@csstools/css-parser-algorithms';
|
||||
import { FunctionNode } from '@csstools/css-parser-algorithms';
|
||||
|
||||
/**
|
||||
* Convert a color function to a `ColorData` object.
|
||||
*
|
||||
* @param {ComponentValue} colorNode - The color function to be converted.
|
||||
* @returns {ColorData|false} The color function as a `ColorData` object or `false` if it could not be converted.
|
||||
*/
|
||||
export declare function color(colorNode: ComponentValue): ColorData | false;
|
||||
|
||||
/**
|
||||
* A color data object.
|
||||
* It contains as much information as possible about the color and the original parsed syntax.
|
||||
*/
|
||||
export declare interface ColorData {
|
||||
/**
|
||||
* The color notation of the color data.
|
||||
*
|
||||
* We use "color notation" and not "color space" because these represent the original notation and not the actual color space.
|
||||
* The actual color space is however always implied by the color notation.
|
||||
*/
|
||||
colorNotation: ColorNotation;
|
||||
/**
|
||||
* The color channels.
|
||||
* This is always an array of three numbers
|
||||
* but the channels can only be interpreted by looking at the color notation.
|
||||
*/
|
||||
channels: Color;
|
||||
/**
|
||||
* The alpha channel.
|
||||
* This is either a number between `0` and `1` or a `ComponentValue` object.
|
||||
*
|
||||
* Since most computations are not dependent on the alpha channel,
|
||||
* we allow things like `var(--some-alpha)` as an alpha channel value for most inputs.
|
||||
*/
|
||||
alpha: number | ComponentValue;
|
||||
/**
|
||||
* Information about the original syntax.
|
||||
*/
|
||||
syntaxFlags: Set<SyntaxFlag>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a color data object fits the `display-p3` gamut.
|
||||
*
|
||||
* @param {ColorData} x - The color data to be checked.
|
||||
* @returns {boolean} Whether the color data fits the `display-p3` gamut.
|
||||
*/
|
||||
export declare function colorDataFitsDisplayP3_Gamut(x: ColorData): boolean;
|
||||
|
||||
/**
|
||||
* Check if a color data object fits the `sRGB` gamut.
|
||||
*
|
||||
* @param {ColorData} x - The color data to be checked.
|
||||
* @returns {boolean} Whether the color data fits the `sRGB` gamut.
|
||||
*/
|
||||
export declare function colorDataFitsRGB_Gamut(x: ColorData): boolean;
|
||||
|
||||
export declare enum ColorNotation {
|
||||
/** Adobe 1999, expressed through `color(a98-rgb 0 0 0)` */
|
||||
A98_RGB = "a98-rgb",
|
||||
/** Display P3, expressed through `color(display-p3 0 0 0)` */
|
||||
Display_P3 = "display-p3",
|
||||
/** Display P3, expressed through `color(display-p3-linear 0 0 0)` */
|
||||
Linear_Display_P3 = "display-p3-linear",
|
||||
/** Hex, expressed through `#000` */
|
||||
HEX = "hex",
|
||||
/** HSL, expressed through `hsl(0 0% 0%)` */
|
||||
HSL = "hsl",
|
||||
/** HWB, expressed through `hwb(0 0% 0%)` */
|
||||
HWB = "hwb",
|
||||
/** LCH, expressed through `lch(0 0% 0deg)` */
|
||||
LCH = "lch",
|
||||
/** Lab, expressed through `lab(0 0 0)` */
|
||||
Lab = "lab",
|
||||
/** Linear sRGB, expressed through `color(linear-srgb 0 0 0)` */
|
||||
Linear_sRGB = "srgb-linear",
|
||||
/** Oklch, expressed through `oklch(0 0% 0deg)` */
|
||||
OKLCH = "oklch",
|
||||
/** Oklab, expressed through `oklab(0 0 0)` */
|
||||
OKLab = "oklab",
|
||||
/** ProPhoto RGB, expressed through `color(prophoto-rgb 0 0 0)` */
|
||||
ProPhoto_RGB = "prophoto-rgb",
|
||||
/** RGB, expressed through `rgb(0 0 0)` */
|
||||
RGB = "rgb",
|
||||
/** sRGB, expressed through `color(srgb 0 0 0)` */
|
||||
sRGB = "srgb",
|
||||
/** Rec. 2020, expressed through `color(rec2020 0 0 0)` */
|
||||
Rec2020 = "rec2020",
|
||||
/** XYZ, expressed through `color(xyz-d50 0 0 0)` */
|
||||
XYZ_D50 = "xyz-d50",
|
||||
/** XYZ, expressed through `color(xyz-d65 0 0 0)` */
|
||||
XYZ_D65 = "xyz-d65"
|
||||
}
|
||||
|
||||
export declare function computedValue(color: ColorData, convertHslOrHwbToRGB?: boolean): string;
|
||||
|
||||
export declare function serializeHSL(color: ColorData, gamutMapping?: boolean): FunctionNode;
|
||||
|
||||
/**
|
||||
* Convert color data to component values in the OKLCH color space.
|
||||
* The return value can be converted to a string by calling `toString()` on it.
|
||||
*
|
||||
* @param {ColorData} color - The color data to be serialized.
|
||||
* @returns {FunctionNode} The serialized color data as a FunctionNode object.
|
||||
*/
|
||||
export declare function serializeOKLCH(color: ColorData): FunctionNode;
|
||||
|
||||
/**
|
||||
* Convert color data to component values in the display-p3 color space.
|
||||
* The return value can be converted to a string by calling `toString()` on it.
|
||||
*
|
||||
* @param {ColorData} color - The color data to be serialized.
|
||||
* @param {boolean} gamutMapping - Whether to perform gamut mapping, defaults to `true`.
|
||||
* @returns {FunctionNode} The serialized color data as a FunctionNode object.
|
||||
*/
|
||||
export declare function serializeP3(color: ColorData, gamutMapping?: boolean): FunctionNode;
|
||||
|
||||
/**
|
||||
* Convert color data to component values in the srgb color space.
|
||||
* The return value can be converted to a string by calling `toString()` on it.
|
||||
*
|
||||
* @param {ColorData} color - The color data to be serialized.
|
||||
* @param {boolean} gamutMapping - Whether to perform gamut mapping, defaults to `true`.
|
||||
* @returns {FunctionNode} The serialized color data as a FunctionNode object.
|
||||
*/
|
||||
export declare function serializeRGB(color: ColorData, gamutMapping?: boolean): FunctionNode;
|
||||
|
||||
export declare enum SyntaxFlag {
|
||||
/** Is a color keyword, e.g. `transparent`, `currentColor`, ... */
|
||||
ColorKeyword = "color-keyword",
|
||||
/** Has an explicit alpha channel */
|
||||
HasAlpha = "has-alpha",
|
||||
/** Has a channel with a dimension value, e.g. `50deg` */
|
||||
HasDimensionValues = "has-dimension-values",
|
||||
/** Has a channel with the `none` keyword */
|
||||
HasNoneKeywords = "has-none-keywords",
|
||||
/** Has a channel with a number value */
|
||||
HasNumberValues = "has-number-values",
|
||||
/** Has an alpha channel with a percentage value */
|
||||
HasPercentageAlpha = "has-percentage-alpha",
|
||||
/** Has a channel with a percentage value */
|
||||
HasPercentageValues = "has-percentage-values",
|
||||
/** Has an alpha channel with a `var()` function value */
|
||||
HasVariableAlpha = "has-variable-alpha",
|
||||
/** Is Hex notation */
|
||||
Hex = "hex",
|
||||
/** Is legacy HSL, e.g. `hsl(50deg, 0%, 0%)` */
|
||||
LegacyHSL = "legacy-hsl",
|
||||
/** Is legacy RGB, e.g. `rgb(0, 0, 0)` */
|
||||
LegacyRGB = "legacy-rgb",
|
||||
/** Is a named color, e.g. `red`, `blue` */
|
||||
NamedColor = "named-color",
|
||||
/** Is a relative color syntax, e.g. `rgb(from purple r g b)` */
|
||||
RelativeColorSyntax = "relative-color-syntax",
|
||||
/** Is a mixed color, e.g. `color-mix(in oklch, red, blue)` */
|
||||
ColorMix = "color-mix",
|
||||
/** Is a variadic mixed color, e.g. `color-mix(in oklch, red)` `color-mix(in oklch, red, blue, green)` */
|
||||
ColorMixVariadic = "color-mix-variadic",
|
||||
/** Is a contrasting color, e.g. `contrast-color()` */
|
||||
ContrastColor = "contrast-color",
|
||||
/** Is a relative alpha syntax `alpha(from red / 0.5)` */
|
||||
RelativeAlphaSyntax = "relative-alpha-syntax",
|
||||
/** Is an experimental color syntax */
|
||||
Experimental = "experimental"
|
||||
}
|
||||
|
||||
export { }
|
||||
1
node_modules/@csstools/css-color-parser/dist/index.mjs
generated
vendored
Normal file
1
node_modules/@csstools/css-color-parser/dist/index.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
64
node_modules/@csstools/css-color-parser/package.json
generated
vendored
Normal file
64
node_modules/@csstools/css-color-parser/package.json
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"name": "@csstools/css-color-parser",
|
||||
"description": "Parse CSS color values",
|
||||
"version": "4.2.0",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Antonio Laguna",
|
||||
"email": "antonio@laguna.es",
|
||||
"url": "https://antonio.laguna.es"
|
||||
},
|
||||
{
|
||||
"name": "Romain Menke",
|
||||
"email": "romainmenke@gmail.com"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/csstools"
|
||||
},
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/csstools"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.19.0"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.mjs"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"CHANGELOG.md",
|
||||
"LICENSE.md",
|
||||
"README.md",
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@csstools/color-helpers": "^6.1.1",
|
||||
"@csstools/css-calc": "^3.3.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@csstools/css-parser-algorithms": "^4.0.0",
|
||||
"@csstools/css-tokenizer": "^4.0.0"
|
||||
},
|
||||
"scripts": {},
|
||||
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/csstools/postcss-plugins.git",
|
||||
"directory": "packages/css-color-parser"
|
||||
},
|
||||
"bugs": "https://github.com/csstools/postcss-plugins/issues",
|
||||
"keywords": [
|
||||
"color",
|
||||
"css",
|
||||
"parser"
|
||||
]
|
||||
}
|
||||
11
node_modules/@csstools/css-parser-algorithms/CHANGELOG.md
generated
vendored
Normal file
11
node_modules/@csstools/css-parser-algorithms/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# Changes to CSS Parser Algorithms
|
||||
|
||||
### 4.0.0
|
||||
|
||||
_January 14, 2026_
|
||||
|
||||
- Updated: Support for Node `20.19.0` or later (major).
|
||||
- Removed: `commonjs` API. In supported Node versions `require(esm)` will work without needing to make code changes.
|
||||
- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`4.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#400) (major)
|
||||
|
||||
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md)
|
||||
20
node_modules/@csstools/css-parser-algorithms/LICENSE.md
generated
vendored
Normal file
20
node_modules/@csstools/css-parser-algorithms/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2022 Romain Menke, Antonio Laguna <antonio@laguna.es>
|
||||
|
||||
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.
|
||||
119
node_modules/@csstools/css-parser-algorithms/README.md
generated
vendored
Normal file
119
node_modules/@csstools/css-parser-algorithms/README.md
generated
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
# CSS Parser Algorithms <img src="https://cssdb.org/images/css.svg" alt="for CSS" width="90" height="90" align="right">
|
||||
|
||||
[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/css-parser-algorithms.svg" height="20">][npm-url]
|
||||
[<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/actions/workflows/test.yml/badge.svg?branch=main" height="20">][cli-url]
|
||||
[<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
|
||||
|
||||
Implemented from : https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/
|
||||
|
||||
## API
|
||||
|
||||
[Read the API docs](./docs/css-parser-algorithms.md)
|
||||
|
||||
## Usage
|
||||
|
||||
Add [CSS Parser Algorithms] to your project:
|
||||
|
||||
```bash
|
||||
npm install @csstools/css-parser-algorithms @csstools/css-tokenizer --save-dev
|
||||
```
|
||||
|
||||
[CSS Parser Algorithms] only accepts tokenized CSS.
|
||||
It must be used together with `@csstools/css-tokenizer`.
|
||||
|
||||
|
||||
```js
|
||||
import { tokenizer, TokenType } from '@csstools/css-tokenizer';
|
||||
import { parseComponentValue } from '@csstools/css-parser-algorithms';
|
||||
|
||||
const myCSS = `@media only screen and (min-width: 768rem) {
|
||||
.foo {
|
||||
content: 'Some content!' !important;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const t = tokenizer({
|
||||
css: myCSS,
|
||||
});
|
||||
|
||||
const tokens = [];
|
||||
|
||||
{
|
||||
while (!t.endOfFile()) {
|
||||
tokens.push(t.nextToken());
|
||||
}
|
||||
|
||||
tokens.push(t.nextToken()); // EOF-token
|
||||
}
|
||||
|
||||
const options = {
|
||||
onParseError: ((err) => {
|
||||
throw err;
|
||||
}),
|
||||
};
|
||||
|
||||
const result = parseComponentValue(tokens, options);
|
||||
|
||||
console.log(result);
|
||||
```
|
||||
|
||||
### Available functions
|
||||
|
||||
- [`parseComponentValue`](https://www.w3.org/TR/css-syntax-3/#parse-component-value)
|
||||
- [`parseListOfComponentValues`](https://www.w3.org/TR/css-syntax-3/#parse-list-of-component-values)
|
||||
- [`parseCommaSeparatedListOfComponentValues`](https://www.w3.org/TR/css-syntax-3/#parse-comma-separated-list-of-component-values)
|
||||
|
||||
### Utilities
|
||||
|
||||
#### `gatherNodeAncestry`
|
||||
|
||||
The AST does not expose the entire ancestry of each node.
|
||||
The walker methods do provide access to the current parent, but also not the entire ancestry.
|
||||
|
||||
To gather the entire ancestry for a a given sub tree of the AST you can use `gatherNodeAncestry`.
|
||||
The result is a `Map` with the child nodes as keys and the parents as values.
|
||||
This allows you to lookup any ancestor of any node.
|
||||
|
||||
```js
|
||||
import { parseComponentValue } from '@csstools/css-parser-algorithms';
|
||||
|
||||
const result = parseComponentValue(tokens, options);
|
||||
const ancestry = gatherNodeAncestry(result);
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```ts
|
||||
{
|
||||
onParseError?: (error: ParseError) => void
|
||||
}
|
||||
```
|
||||
|
||||
#### `onParseError`
|
||||
|
||||
The parser algorithms are forgiving and won't stop when a parse error is encountered.
|
||||
Parse errors also aren't tokens.
|
||||
|
||||
To receive parsing error information you can set a callback.
|
||||
|
||||
Parser errors will try to inform you about the point in the parsing logic the error happened.
|
||||
This tells you the kind of error.
|
||||
|
||||
## Goals and non-goals
|
||||
|
||||
Things this package aims to be:
|
||||
- specification compliant CSS parser
|
||||
- a reliable low level package to be used in CSS sub-grammars
|
||||
|
||||
What it is not:
|
||||
- opinionated
|
||||
- fast
|
||||
- small
|
||||
- a replacement for PostCSS (PostCSS is fast and also an ecosystem)
|
||||
|
||||
[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
|
||||
[discord]: https://discord.gg/bUadyRwkJS
|
||||
[npm-url]: https://www.npmjs.com/package/@csstools/css-parser-algorithms
|
||||
|
||||
[CSS Parser Algorithms]: https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms
|
||||
604
node_modules/@csstools/css-parser-algorithms/dist/index.d.ts
generated
vendored
Normal file
604
node_modules/@csstools/css-parser-algorithms/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,604 @@
|
||||
/**
|
||||
* Parse CSS following the {@link https://drafts.csswg.org/css-syntax/#parsing | CSS Syntax Level 3 specification}.
|
||||
*
|
||||
* @remarks
|
||||
* The tokenizing and parsing tools provided by CSS Tools are designed to be low level and generic with strong ties to their respective specifications.
|
||||
*
|
||||
* Any analysis or mutation of CSS source code should be done with the least powerful tool that can accomplish the task.
|
||||
* For many applications it is sufficient to work with tokens.
|
||||
* For others you might need to use {@link https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms | @csstools/css-parser-algorithms} or a more specific parser.
|
||||
*
|
||||
* The implementation of the AST nodes is kept lightweight and simple.
|
||||
* Do not expect magic methods, instead assume that arrays and class instances behave like any other JavaScript.
|
||||
*
|
||||
* @example
|
||||
* Parse a string of CSS into a component value:
|
||||
* ```js
|
||||
* import { tokenize } from '@csstools/css-tokenizer';
|
||||
* import { parseComponentValue } from '@csstools/css-parser-algorithms';
|
||||
*
|
||||
* const myCSS = `calc(1px * 2)`;
|
||||
*
|
||||
* const componentValue = parseComponentValue(tokenize({
|
||||
* css: myCSS,
|
||||
* }));
|
||||
*
|
||||
* console.log(componentValue);
|
||||
* ```
|
||||
*
|
||||
* @example
|
||||
* Use the right algorithm for the job.
|
||||
*
|
||||
* Algorithms that can parse larger structures (comma-separated lists, ...) can also parse smaller structures.
|
||||
* However, the opposite is not true.
|
||||
*
|
||||
* If your context allows a list of component values, use {@link parseListOfComponentValues}:
|
||||
* ```js
|
||||
* import { tokenize } from '@csstools/css-tokenizer';
|
||||
* import { parseListOfComponentValues } from '@csstools/css-parser-algorithms';
|
||||
*
|
||||
* parseListOfComponentValues(tokenize({ css: `10x 20px` }));
|
||||
* ```
|
||||
*
|
||||
* If your context allows a comma-separated list of component values, use {@link parseCommaSeparatedListOfComponentValues}:
|
||||
* ```js
|
||||
* import { tokenize } from '@csstools/css-tokenizer';
|
||||
* import { parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser-algorithms';
|
||||
*
|
||||
* parseCommaSeparatedListOfComponentValues(tokenize({ css: `20deg, 50%, 30%` }));
|
||||
* ```
|
||||
*
|
||||
* @example
|
||||
* Use the stateful walkers to keep track of the context of a given component value.
|
||||
*
|
||||
* ```js
|
||||
* import { tokenize } from '@csstools/css-tokenizer';
|
||||
* import { parseComponentValue, isSimpleBlockNode } from '@csstools/css-parser-algorithms';
|
||||
*
|
||||
* const myCSS = `calc(1px * (5 / 2))`;
|
||||
*
|
||||
* const componentValue = parseComponentValue(tokenize({ css: myCSS }));
|
||||
*
|
||||
* let state = { inSimpleBlock: false };
|
||||
* componentValue.walk((entry) => {
|
||||
* if (isSimpleBlockNode(entry)) {
|
||||
* entry.state.inSimpleBlock = true;
|
||||
* return;
|
||||
* }
|
||||
*
|
||||
* if (entry.state.inSimpleBlock) {
|
||||
* console.log(entry.node.toString()); // `5`, ...
|
||||
* }
|
||||
* }, state);
|
||||
* ```
|
||||
*
|
||||
* @packageDocumentation
|
||||
*/
|
||||
|
||||
import type { CSSToken } from '@csstools/css-tokenizer';
|
||||
import { ParseError } from '@csstools/css-tokenizer';
|
||||
import type { TokenFunction } from '@csstools/css-tokenizer';
|
||||
|
||||
export declare class CommentNode {
|
||||
/**
|
||||
* The node type, always `ComponentValueType.Comment`
|
||||
*/
|
||||
type: ComponentValueType;
|
||||
/**
|
||||
* The comment token.
|
||||
*/
|
||||
value: CSSToken;
|
||||
constructor(value: CSSToken);
|
||||
/**
|
||||
* Retrieve the tokens for the current comment.
|
||||
* This is the inverse of parsing from a list of tokens.
|
||||
*/
|
||||
tokens(): Array<CSSToken>;
|
||||
/**
|
||||
* Convert the current comment to a string.
|
||||
* This is not a true serialization.
|
||||
* It is purely a concatenation of the string representation of the tokens.
|
||||
*/
|
||||
toString(): string;
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* A debug helper to convert the current object to a JSON representation.
|
||||
* This is useful in asserts and to store large ASTs in files.
|
||||
*/
|
||||
toJSON(): Record<string, unknown>;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
isCommentNode(): this is CommentNode;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
static isCommentNode(x: unknown): x is CommentNode;
|
||||
}
|
||||
|
||||
export declare type ComponentValue = FunctionNode | SimpleBlockNode | WhitespaceNode | CommentNode | TokenNode;
|
||||
|
||||
export declare enum ComponentValueType {
|
||||
Function = "function",
|
||||
SimpleBlock = "simple-block",
|
||||
Whitespace = "whitespace",
|
||||
Comment = "comment",
|
||||
Token = "token"
|
||||
}
|
||||
|
||||
export declare type ContainerNode = FunctionNode | SimpleBlockNode;
|
||||
|
||||
export declare abstract class ContainerNodeBaseClass {
|
||||
/**
|
||||
* The contents of the `Function` or `Simple Block`.
|
||||
* This is a list of component values.
|
||||
*/
|
||||
value: Array<ComponentValue>;
|
||||
/**
|
||||
* Retrieve the index of the given item in the current node.
|
||||
* For most node types this will be trivially implemented as `this.value.indexOf(item)`.
|
||||
*/
|
||||
indexOf(item: ComponentValue): number | string;
|
||||
/**
|
||||
* Retrieve the item at the given index in the current node.
|
||||
* For most node types this will be trivially implemented as `this.value[index]`.
|
||||
*/
|
||||
at(index: number | string): ComponentValue | undefined;
|
||||
/**
|
||||
* Iterates over each item in the `value` array of the current node.
|
||||
*
|
||||
* @param cb - The callback function to execute for each item.
|
||||
* The function receives an object containing the current node (`node`), its parent (`parent`),
|
||||
* and an optional `state` object.
|
||||
* A second parameter is the index of the current node.
|
||||
* The function can return `false` to stop the iteration.
|
||||
*
|
||||
* @param state - An optional state object that can be used to pass additional information to the callback function.
|
||||
* The state object is cloned for each iteration. This means that changes to the state object are not reflected in the next iteration.
|
||||
*
|
||||
* @returns `false` if the iteration was halted, `undefined` otherwise.
|
||||
*/
|
||||
forEach<T extends Record<string, unknown>, U extends ContainerNode>(this: U, cb: (entry: {
|
||||
node: ComponentValue;
|
||||
parent: ContainerNode;
|
||||
state?: T;
|
||||
}, index: number | string) => boolean | void, state?: T): false | undefined;
|
||||
/**
|
||||
* Walks the current node and all its children.
|
||||
*
|
||||
* @param cb - The callback function to execute for each item.
|
||||
* The function receives an object containing the current node (`node`), its parent (`parent`),
|
||||
* and an optional `state` object.
|
||||
* A second parameter is the index of the current node.
|
||||
* The function can return `false` to stop the iteration.
|
||||
*
|
||||
* @param state - An optional state object that can be used to pass additional information to the callback function.
|
||||
* The state object is cloned for each iteration. This means that changes to the state object are not reflected in the next iteration.
|
||||
* However changes are passed down to child node iterations.
|
||||
*
|
||||
* @returns `false` if the iteration was halted, `undefined` otherwise.
|
||||
*/
|
||||
walk<T extends Record<string, unknown>, U extends ContainerNode>(this: U, cb: (entry: {
|
||||
node: ComponentValue;
|
||||
parent: ContainerNode;
|
||||
state?: T;
|
||||
}, index: number | string) => boolean | void, state?: T): false | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterates over each item in a list of component values.
|
||||
*
|
||||
* @param cb - The callback function to execute for each item.
|
||||
* The function receives an object containing the current node (`node`), its parent (`parent`),
|
||||
* and an optional `state` object.
|
||||
* A second parameter is the index of the current node.
|
||||
* The function can return `false` to stop the iteration.
|
||||
*
|
||||
* @param state - An optional state object that can be used to pass additional information to the callback function.
|
||||
* The state object is cloned for each iteration. This means that changes to the state object are not reflected in the next iteration.
|
||||
*
|
||||
* @returns `false` if the iteration was halted, `undefined` otherwise.
|
||||
*/
|
||||
export declare function forEach<T extends Record<string, unknown>>(componentValues: Array<ComponentValue>, cb: (entry: {
|
||||
node: ComponentValue;
|
||||
parent: ContainerNode | {
|
||||
value: Array<ComponentValue>;
|
||||
};
|
||||
state?: T;
|
||||
}, index: number | string) => boolean | void, state?: T): false | undefined;
|
||||
|
||||
/**
|
||||
* A function node.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* const node = parseComponentValue(tokenize('calc(1 + 1)'));
|
||||
*
|
||||
* isFunctionNode(node); // true
|
||||
* node.getName(); // 'calc'
|
||||
* ```
|
||||
*/
|
||||
export declare class FunctionNode extends ContainerNodeBaseClass {
|
||||
/**
|
||||
* The node type, always `ComponentValueType.Function`
|
||||
*/
|
||||
type: ComponentValueType;
|
||||
/**
|
||||
* The token for the name of the function.
|
||||
*/
|
||||
name: TokenFunction;
|
||||
/**
|
||||
* The token for the closing parenthesis of the function.
|
||||
* If the function is unclosed, this will be an EOF token.
|
||||
*/
|
||||
endToken: CSSToken;
|
||||
constructor(name: TokenFunction, endToken: CSSToken, value: Array<ComponentValue>);
|
||||
/**
|
||||
* Retrieve the name of the current function.
|
||||
* This is the parsed and unescaped name of the function.
|
||||
*/
|
||||
getName(): string;
|
||||
/**
|
||||
* Normalize the current function:
|
||||
* 1. if the "endToken" is EOF, replace with a ")-token"
|
||||
*/
|
||||
normalize(): void;
|
||||
/**
|
||||
* Retrieve the tokens for the current function.
|
||||
* This is the inverse of parsing from a list of tokens.
|
||||
*/
|
||||
tokens(): Array<CSSToken>;
|
||||
/**
|
||||
* Convert the current function to a string.
|
||||
* This is not a true serialization.
|
||||
* It is purely a concatenation of the string representation of the tokens.
|
||||
*/
|
||||
toString(): string;
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* A debug helper to convert the current object to a JSON representation.
|
||||
* This is useful in asserts and to store large ASTs in files.
|
||||
*/
|
||||
toJSON(): unknown;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
isFunctionNode(): this is FunctionNode;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
static isFunctionNode(x: unknown): x is FunctionNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* AST nodes do not have a `parent` property or method.
|
||||
* This makes it harder to traverse the AST upwards.
|
||||
* This function builds a `Map<Child, Parent>` that can be used to lookup ancestors of a node.
|
||||
*
|
||||
* @remarks
|
||||
* There is no magic behind this or the map it returns.
|
||||
* Mutating the AST will not update the map.
|
||||
*
|
||||
* Types are erased and any content of the map has type `unknown`.
|
||||
* If someone knows a clever way to type this, please let us know.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* const ancestry = gatherNodeAncestry(mediaQuery);
|
||||
* mediaQuery.walk((entry) => {
|
||||
* const node = entry.node; // directly exposed
|
||||
* const parent = entry.parent; // directly exposed
|
||||
* const grandParent: unknown = ancestry.get(parent); // lookup
|
||||
*
|
||||
* console.log('node', node);
|
||||
* console.log('parent', parent);
|
||||
* console.log('grandParent', grandParent);
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export declare function gatherNodeAncestry(node: {
|
||||
walk(cb: (entry: {
|
||||
node: unknown;
|
||||
parent: unknown;
|
||||
}, index: number | string) => boolean | void): false | undefined;
|
||||
}): Map<unknown, unknown>;
|
||||
|
||||
/**
|
||||
* Check if the current object is a `CommentNode`.
|
||||
* This is a type guard.
|
||||
*/
|
||||
export declare function isCommentNode(x: unknown): x is CommentNode;
|
||||
|
||||
/**
|
||||
* Check if the current object is a `FunctionNode`.
|
||||
* This is a type guard.
|
||||
*/
|
||||
export declare function isFunctionNode(x: unknown): x is FunctionNode;
|
||||
|
||||
/**
|
||||
* Check if the current object is a `SimpleBlockNode`.
|
||||
* This is a type guard.
|
||||
*/
|
||||
export declare function isSimpleBlockNode(x: unknown): x is SimpleBlockNode;
|
||||
|
||||
/**
|
||||
* Check if the current object is a `TokenNode`.
|
||||
* This is a type guard.
|
||||
*/
|
||||
export declare function isTokenNode(x: unknown): x is TokenNode;
|
||||
|
||||
/**
|
||||
* Check if the current object is a `WhitespaceNode`.
|
||||
* This is a type guard.
|
||||
*/
|
||||
export declare function isWhitespaceNode(x: unknown): x is WhitespaceNode;
|
||||
|
||||
/**
|
||||
* Check if the current object is a `WhiteSpaceNode` or a `CommentNode`.
|
||||
* This is a type guard.
|
||||
*/
|
||||
export declare function isWhiteSpaceOrCommentNode(x: unknown): x is WhitespaceNode | CommentNode;
|
||||
|
||||
/**
|
||||
* Parse a comma-separated list of component values.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* import { tokenize } from '@csstools/css-tokenizer';
|
||||
* import { parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser-algorithms';
|
||||
*
|
||||
* parseCommaSeparatedListOfComponentValues(tokenize({ css: `20deg, 50%, 30%` }));
|
||||
* ```
|
||||
*/
|
||||
export declare function parseCommaSeparatedListOfComponentValues(tokens: Array<CSSToken>, options?: {
|
||||
onParseError?: (error: ParseError) => void;
|
||||
}): Array<Array<ComponentValue>>;
|
||||
|
||||
/**
|
||||
* Parse a single component value.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* import { tokenize } from '@csstools/css-tokenizer';
|
||||
* import { parseComponentValue } from '@csstools/css-parser-algorithms';
|
||||
*
|
||||
* parseComponentValue(tokenize({ css: `10px` }));
|
||||
* parseComponentValue(tokenize({ css: `calc((10px + 1x) * 4)` }));
|
||||
* ```
|
||||
*/
|
||||
export declare function parseComponentValue(tokens: Array<CSSToken>, options?: {
|
||||
onParseError?: (error: ParseError) => void;
|
||||
}): ComponentValue | undefined;
|
||||
|
||||
/**
|
||||
* Parse a list of component values.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* import { tokenize } from '@csstools/css-tokenizer';
|
||||
* import { parseListOfComponentValues } from '@csstools/css-parser-algorithms';
|
||||
*
|
||||
* parseListOfComponentValues(tokenize({ css: `20deg 30%` }));
|
||||
* ```
|
||||
*/
|
||||
export declare function parseListOfComponentValues(tokens: Array<CSSToken>, options?: {
|
||||
onParseError?: (error: ParseError) => void;
|
||||
}): Array<ComponentValue>;
|
||||
|
||||
/**
|
||||
* Replace specific component values in a list of component values.
|
||||
* A helper for the most common and simplistic cases when mutating an AST.
|
||||
*/
|
||||
export declare function replaceComponentValues(componentValuesList: Array<Array<ComponentValue>>, replaceWith: (componentValue: ComponentValue) => Array<ComponentValue> | ComponentValue | void): Array<Array<ComponentValue>>;
|
||||
|
||||
/**
|
||||
* A simple block node.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* const node = parseComponentValue(tokenize('[foo=bar]'));
|
||||
*
|
||||
* isSimpleBlockNode(node); // true
|
||||
* node.startToken; // [TokenType.OpenSquare, '[', 0, 0, undefined]
|
||||
* ```
|
||||
*/
|
||||
export declare class SimpleBlockNode extends ContainerNodeBaseClass {
|
||||
/**
|
||||
* The node type, always `ComponentValueType.SimpleBlock`
|
||||
*/
|
||||
type: ComponentValueType;
|
||||
/**
|
||||
* The token for the opening token of the block.
|
||||
*/
|
||||
startToken: CSSToken;
|
||||
/**
|
||||
* The token for the closing token of the block.
|
||||
* If the block is closed it will be the mirror variant of the `startToken`.
|
||||
* If the block is unclosed, this will be an EOF token.
|
||||
*/
|
||||
endToken: CSSToken;
|
||||
constructor(startToken: CSSToken, endToken: CSSToken, value: Array<ComponentValue>);
|
||||
/**
|
||||
* Normalize the current simple block
|
||||
* 1. if the "endToken" is EOF, replace with the mirror token of the "startToken"
|
||||
*/
|
||||
normalize(): void;
|
||||
/**
|
||||
* Retrieve the tokens for the current simple block.
|
||||
* This is the inverse of parsing from a list of tokens.
|
||||
*/
|
||||
tokens(): Array<CSSToken>;
|
||||
/**
|
||||
* Convert the current simple block to a string.
|
||||
* This is not a true serialization.
|
||||
* It is purely a concatenation of the string representation of the tokens.
|
||||
*/
|
||||
toString(): string;
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* A debug helper to convert the current object to a JSON representation.
|
||||
* This is useful in asserts and to store large ASTs in files.
|
||||
*/
|
||||
toJSON(): unknown;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
isSimpleBlockNode(): this is SimpleBlockNode;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
static isSimpleBlockNode(x: unknown): x is SimpleBlockNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the start and end index of a node in the CSS source string.
|
||||
*/
|
||||
export declare function sourceIndices(x: {
|
||||
tokens(): Array<CSSToken>;
|
||||
} | Array<{
|
||||
tokens(): Array<CSSToken>;
|
||||
}>): [number, number];
|
||||
|
||||
/**
|
||||
* Concatenate the string representation of a collection of component values.
|
||||
* This is not a proper serializer that will handle escaping and whitespace.
|
||||
* It only produces valid CSS for token lists that are also valid.
|
||||
*/
|
||||
export declare function stringify(componentValueLists: Array<Array<ComponentValue>>): string;
|
||||
|
||||
export declare class TokenNode {
|
||||
/**
|
||||
* The node type, always `ComponentValueType.Token`
|
||||
*/
|
||||
type: ComponentValueType;
|
||||
/**
|
||||
* The token.
|
||||
*/
|
||||
value: CSSToken;
|
||||
constructor(value: CSSToken);
|
||||
/**
|
||||
* This is the inverse of parsing from a list of tokens.
|
||||
*/
|
||||
tokens(): [CSSToken];
|
||||
/**
|
||||
* Convert the current token to a string.
|
||||
* This is not a true serialization.
|
||||
* It is purely the string representation of token.
|
||||
*/
|
||||
toString(): string;
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* A debug helper to convert the current object to a JSON representation.
|
||||
* This is useful in asserts and to store large ASTs in files.
|
||||
*/
|
||||
toJSON(): Record<string, unknown>;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
isTokenNode(): this is TokenNode;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
static isTokenNode(x: unknown): x is TokenNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Walks each item in a list of component values all of their children.
|
||||
*
|
||||
* @param cb - The callback function to execute for each item.
|
||||
* The function receives an object containing the current node (`node`), its parent (`parent`),
|
||||
* and an optional `state` object.
|
||||
* A second parameter is the index of the current node.
|
||||
* The function can return `false` to stop the iteration.
|
||||
*
|
||||
* @param state - An optional state object that can be used to pass additional information to the callback function.
|
||||
* The state object is cloned for each iteration. This means that changes to the state object are not reflected in the next iteration.
|
||||
* However changes are passed down to child node iterations.
|
||||
*
|
||||
* @returns `false` if the iteration was halted, `undefined` otherwise.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* import { tokenize } from '@csstools/css-tokenizer';
|
||||
* import { parseListOfComponentValues, isSimpleBlockNode } from '@csstools/css-parser-algorithms';
|
||||
*
|
||||
* const myCSS = `calc(1px * (5 / 2)) 10px`;
|
||||
*
|
||||
* const componentValues = parseListOfComponentValues(tokenize({ css: myCSS }));
|
||||
*
|
||||
* let state = { inSimpleBlock: false };
|
||||
* walk(componentValues, (entry) => {
|
||||
* if (isSimpleBlockNode(entry)) {
|
||||
* entry.state.inSimpleBlock = true;
|
||||
* return;
|
||||
* }
|
||||
*
|
||||
* if (entry.state.inSimpleBlock) {
|
||||
* console.log(entry.node.toString()); // `5`, ...
|
||||
* }
|
||||
* }, state);
|
||||
* ```
|
||||
*/
|
||||
export declare function walk<T extends Record<string, unknown>>(componentValues: Array<ComponentValue>, cb: (entry: {
|
||||
node: ComponentValue;
|
||||
parent: ContainerNode | {
|
||||
value: Array<ComponentValue>;
|
||||
};
|
||||
state?: T;
|
||||
}, index: number | string) => boolean | void, state?: T): false | undefined;
|
||||
|
||||
/**
|
||||
* Generate a function that finds the next element that should be visited when walking an AST.
|
||||
* Rules :
|
||||
* 1. the previous iteration is used as a reference, so any checks are relative to the start of the current iteration.
|
||||
* 2. the next element always appears after the current index.
|
||||
* 3. the next element always exists in the list.
|
||||
* 4. replacing an element does not cause the replaced element to be visited.
|
||||
* 5. removing an element does not cause elements to be skipped.
|
||||
* 6. an element added later in the list will be visited.
|
||||
*/
|
||||
export declare function walkerIndexGenerator<T>(initialList: Array<T>): (list: Array<T>, child: T, index: number) => number;
|
||||
|
||||
export declare class WhitespaceNode {
|
||||
/**
|
||||
* The node type, always `ComponentValueType.WhiteSpace`
|
||||
*/
|
||||
type: ComponentValueType;
|
||||
/**
|
||||
* The list of consecutive whitespace tokens.
|
||||
*/
|
||||
value: Array<CSSToken>;
|
||||
constructor(value: Array<CSSToken>);
|
||||
/**
|
||||
* Retrieve the tokens for the current whitespace.
|
||||
* This is the inverse of parsing from a list of tokens.
|
||||
*/
|
||||
tokens(): Array<CSSToken>;
|
||||
/**
|
||||
* Convert the current whitespace to a string.
|
||||
* This is not a true serialization.
|
||||
* It is purely a concatenation of the string representation of the tokens.
|
||||
*/
|
||||
toString(): string;
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* A debug helper to convert the current object to a JSON representation.
|
||||
* This is useful in asserts and to store large ASTs in files.
|
||||
*/
|
||||
toJSON(): Record<string, unknown>;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
isWhitespaceNode(): this is WhitespaceNode;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
static isWhitespaceNode(x: unknown): x is WhitespaceNode;
|
||||
}
|
||||
|
||||
export { }
|
||||
1
node_modules/@csstools/css-parser-algorithms/dist/index.mjs
generated
vendored
Normal file
1
node_modules/@csstools/css-parser-algorithms/dist/index.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
58
node_modules/@csstools/css-parser-algorithms/package.json
generated
vendored
Normal file
58
node_modules/@csstools/css-parser-algorithms/package.json
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"name": "@csstools/css-parser-algorithms",
|
||||
"description": "Algorithms to help you parse CSS from an array of tokens.",
|
||||
"version": "4.0.0",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Antonio Laguna",
|
||||
"email": "antonio@laguna.es",
|
||||
"url": "https://antonio.laguna.es"
|
||||
},
|
||||
{
|
||||
"name": "Romain Menke",
|
||||
"email": "romainmenke@gmail.com"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/csstools"
|
||||
},
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/csstools"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.19.0"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.mjs"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"CHANGELOG.md",
|
||||
"LICENSE.md",
|
||||
"README.md",
|
||||
"dist"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"@csstools/css-tokenizer": "^4.0.0"
|
||||
},
|
||||
"scripts": {},
|
||||
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/csstools/postcss-plugins.git",
|
||||
"directory": "packages/css-parser-algorithms"
|
||||
},
|
||||
"bugs": "https://github.com/csstools/postcss-plugins/issues",
|
||||
"keywords": [
|
||||
"css",
|
||||
"parser"
|
||||
]
|
||||
}
|
||||
9
node_modules/@csstools/css-syntax-patches-for-csstree/CHANGELOG.md
generated
vendored
Normal file
9
node_modules/@csstools/css-syntax-patches-for-csstree/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# Changes to CSS Syntax Patches For CSSTree
|
||||
|
||||
### 1.1.8
|
||||
|
||||
_August 15, 2026_
|
||||
|
||||
- Update `@webref/css` to [`v8.7.1`](https://github.com/w3c/webref/releases/tag/%40webref%2Fcss%408.7.1)
|
||||
|
||||
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/css-syntax-patches-for-csstree/CHANGELOG.md)
|
||||
18
node_modules/@csstools/css-syntax-patches-for-csstree/LICENSE.md
generated
vendored
Normal file
18
node_modules/@csstools/css-syntax-patches-for-csstree/LICENSE.md
generated
vendored
Normal file
@@ -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.
|
||||
43
node_modules/@csstools/css-syntax-patches-for-csstree/README.md
generated
vendored
Normal file
43
node_modules/@csstools/css-syntax-patches-for-csstree/README.md
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
# CSS Syntax Patches For CSSTree <img src="https://cssdb.org/images/css.svg" alt="for CSS" width="90" height="90" align="right">
|
||||
|
||||
[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/css-syntax-patches-for-csstree.svg" height="20">][npm-url]
|
||||
[<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/actions/workflows/test.yml/badge.svg?branch=main" height="20">][cli-url]
|
||||
|
||||
Patch [csstree](https://github.com/csstree/csstree) syntax definitions with the latest data from CSS specifications.
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
npm install @csstools/css-syntax-patches-for-csstree
|
||||
```
|
||||
|
||||
```js
|
||||
import { fork } from 'css-tree';
|
||||
import syntax_patches from '@csstools/css-syntax-patches-for-csstree' with { type: 'json' };
|
||||
|
||||
const forkedLexer = fork({
|
||||
atrules: syntax_patches.next.atrules,
|
||||
properties: syntax_patches.next.properties,
|
||||
types: syntax_patches.next.types,
|
||||
}).lexer;
|
||||
```
|
||||
|
||||
## `next`
|
||||
|
||||
```js
|
||||
import syntax_patches from '@csstools/css-syntax-patches-for-csstree' with { type: 'json' };
|
||||
|
||||
console.log(syntax_patches.next);
|
||||
// ^^^^
|
||||
```
|
||||
|
||||
CSS specifications are often still in flux and various parts might change or disappear altogether.
|
||||
Specifications also contains parts that haven't been implemented yet in a browser.
|
||||
Only CSS that is widely adopted can be expected to be stable.
|
||||
|
||||
The `next` grouping contains a combination of what is currently valid in browsers and the progress in various specifications.
|
||||
|
||||
_In the future more groupings might be added._
|
||||
|
||||
[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
|
||||
[npm-url]: https://www.npmjs.com/package/@csstools/css-syntax-patches-for-csstree
|
||||
5
node_modules/@csstools/css-syntax-patches-for-csstree/dist/index.d.ts
generated
vendored
Normal file
5
node_modules/@csstools/css-syntax-patches-for-csstree/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export const next: {
|
||||
atrules: Record<string, { descriptors: Record<string, string> }>,
|
||||
properties: Record<string, string>,
|
||||
types: Record<string, string>,
|
||||
}
|
||||
802
node_modules/@csstools/css-syntax-patches-for-csstree/dist/index.json
generated
vendored
Normal file
802
node_modules/@csstools/css-syntax-patches-for-csstree/dist/index.json
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
56
node_modules/@csstools/css-syntax-patches-for-csstree/package.json
generated
vendored
Normal file
56
node_modules/@csstools/css-syntax-patches-for-csstree/package.json
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"name": "@csstools/css-syntax-patches-for-csstree",
|
||||
"description": "CSS syntax patches for CSS tree",
|
||||
"version": "1.1.8",
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"main": "dist/index.json",
|
||||
"types": "dist/index.d.ts",
|
||||
"files": [
|
||||
"CHANGELOG.md",
|
||||
"LICENSE.md",
|
||||
"README.md",
|
||||
"dist"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"css-tree": "^3.2.1"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"css-tree": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"scripts": {},
|
||||
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-syntax-patches-for-csstree#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/csstools/postcss-plugins.git",
|
||||
"directory": "packages/css-syntax-patches-for-csstree"
|
||||
},
|
||||
"bugs": "https://github.com/csstools/postcss-plugins/issues",
|
||||
"keywords": [
|
||||
"css",
|
||||
"csstree",
|
||||
"syntax"
|
||||
]
|
||||
}
|
||||
10
node_modules/@csstools/css-tokenizer/CHANGELOG.md
generated
vendored
Normal file
10
node_modules/@csstools/css-tokenizer/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# Changes to CSS Tokenizer
|
||||
|
||||
### 4.0.0
|
||||
|
||||
_January 14, 2026_
|
||||
|
||||
- Updated: Support for Node `20.19.0` or later (major).
|
||||
- Removed: `commonjs` API. In supported Node versions `require(esm)` will work without needing to make code changes.
|
||||
|
||||
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md)
|
||||
20
node_modules/@csstools/css-tokenizer/LICENSE.md
generated
vendored
Normal file
20
node_modules/@csstools/css-tokenizer/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2022 Romain Menke, Antonio Laguna <antonio@laguna.es>
|
||||
|
||||
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.
|
||||
111
node_modules/@csstools/css-tokenizer/README.md
generated
vendored
Normal file
111
node_modules/@csstools/css-tokenizer/README.md
generated
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
# CSS Tokenizer <img src="https://cssdb.org/images/css.svg" alt="for CSS" width="90" height="90" align="right">
|
||||
|
||||
[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/css-tokenizer.svg" height="20">][npm-url]
|
||||
[<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/actions/workflows/test.yml/badge.svg?branch=main" height="20">][cli-url]
|
||||
[<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
|
||||
|
||||
Implemented from : https://drafts.csswg.org/css-syntax/
|
||||
|
||||
## API
|
||||
|
||||
[Read the API docs](./docs/css-tokenizer.md)
|
||||
|
||||
## Usage
|
||||
|
||||
Add [CSS Tokenizer] to your project:
|
||||
|
||||
```bash
|
||||
npm install @csstools/css-tokenizer --save-dev
|
||||
```
|
||||
|
||||
```js
|
||||
import { tokenize } from '@csstools/css-tokenizer';
|
||||
|
||||
const myCSS = `@media only screen and (min-width: 768rem) {
|
||||
.foo {
|
||||
content: 'Some content!' !important;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const tokens = tokenize({
|
||||
css: myCSS,
|
||||
});
|
||||
|
||||
console.log(tokens);
|
||||
```
|
||||
|
||||
Or use the streaming interface:
|
||||
|
||||
```js
|
||||
import { tokenizer, TokenType } from '@csstools/css-tokenizer';
|
||||
|
||||
const myCSS = `@media only screen and (min-width: 768rem) {
|
||||
.foo {
|
||||
content: 'Some content!' !important;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const t = tokenizer({
|
||||
css: myCSS,
|
||||
});
|
||||
|
||||
while (true) {
|
||||
const token = t.nextToken();
|
||||
if (token[0] === TokenType.EOF) {
|
||||
break;
|
||||
}
|
||||
|
||||
console.log(token);
|
||||
}
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```ts
|
||||
{
|
||||
onParseError?: (error: ParseError) => void
|
||||
}
|
||||
```
|
||||
|
||||
#### `onParseError`
|
||||
|
||||
The tokenizer is forgiving and won't stop when a parse error is encountered.
|
||||
|
||||
To receive parsing error information you can set a callback.
|
||||
|
||||
```js
|
||||
import { tokenizer, TokenType } from '@csstools/css-tokenizer';
|
||||
|
||||
const t = tokenizer({
|
||||
css: '\\',
|
||||
}, { onParseError: (err) => console.warn(err) });
|
||||
|
||||
while (true) {
|
||||
const token = t.nextToken();
|
||||
if (token[0] === TokenType.EOF) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Parser errors will try to inform you where in the tokenizer logic the error happened.
|
||||
This tells you what kind of error occurred.
|
||||
|
||||
## Order of priorities
|
||||
|
||||
1. specification compliance
|
||||
2. correctness
|
||||
3. reliability
|
||||
4. tokenizing and serializing must round trip losslessly
|
||||
5. exposing useful aspects about the source code
|
||||
6. runtime performance
|
||||
7. package size
|
||||
|
||||
|
||||
[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
|
||||
[discord]: https://discord.gg/bUadyRwkJS
|
||||
[npm-url]: https://www.npmjs.com/package/@csstools/css-tokenizer
|
||||
|
||||
[CSS Tokenizer]: https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer
|
||||
593
node_modules/@csstools/css-tokenizer/dist/index.d.ts
generated
vendored
Normal file
593
node_modules/@csstools/css-tokenizer/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,593 @@
|
||||
/**
|
||||
* Tokenize CSS following the {@link https://drafts.csswg.org/css-syntax/#tokenization | CSS Syntax Level 3 specification}.
|
||||
*
|
||||
* @remarks
|
||||
* The tokenizing and parsing tools provided by CSS Tools are designed to be low level and generic with strong ties to their respective specifications.
|
||||
*
|
||||
* Any analysis or mutation of CSS source code should be done with the least powerful tool that can accomplish the task.
|
||||
* For many applications it is sufficient to work with tokens.
|
||||
* For others you might need to use {@link https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms | @csstools/css-parser-algorithms} or a more specific parser.
|
||||
*
|
||||
* @example
|
||||
* Tokenize a string of CSS into an array of tokens:
|
||||
* ```js
|
||||
* import { tokenize } from '@csstools/css-tokenizer';
|
||||
*
|
||||
* const myCSS = `@media only screen and (min-width: 768rem) {
|
||||
* .foo {
|
||||
* content: 'Some content!' !important;
|
||||
* }
|
||||
* }
|
||||
* `;
|
||||
*
|
||||
* const tokens = tokenize({
|
||||
* css: myCSS,
|
||||
* });
|
||||
*
|
||||
* console.log(tokens);
|
||||
* ```
|
||||
*
|
||||
* @packageDocumentation
|
||||
*/
|
||||
|
||||
/**
|
||||
* Deep clone a list of tokens.
|
||||
* Useful for mutations without altering the original list.
|
||||
*/
|
||||
export declare function cloneTokens(tokens: Array<CSSToken>): Array<CSSToken>;
|
||||
|
||||
/**
|
||||
* The union of all possible CSS tokens
|
||||
*/
|
||||
export declare type CSSToken = TokenAtKeyword | TokenBadString | TokenBadURL | TokenCDC | TokenCDO | TokenColon | TokenComma | TokenComment | TokenDelim | TokenDimension | TokenEOF | TokenFunction | TokenHash | TokenIdent | TokenNumber | TokenPercentage | TokenSemicolon | TokenString | TokenURL | TokenWhitespace | TokenOpenParen | TokenCloseParen | TokenOpenSquare | TokenCloseSquare | TokenOpenCurly | TokenCloseCurly | TokenUnicodeRange;
|
||||
|
||||
/**
|
||||
* The type of hash token
|
||||
*/
|
||||
export declare enum HashType {
|
||||
/**
|
||||
* The hash token did not start with an ident sequence (e.g. `#-2`)
|
||||
*/
|
||||
Unrestricted = "unrestricted",
|
||||
/**
|
||||
* The hash token started with an ident sequence (e.g. `#foo`)
|
||||
* Only hash tokens with the "id" type are valid ID selectors.
|
||||
*/
|
||||
ID = "id"
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that a given value has the general structure of a CSS token:
|
||||
* 1. is an array.
|
||||
* 2. has at least four items.
|
||||
* 3. has a known token type.
|
||||
* 4. has a string representation.
|
||||
* 5. has a start position.
|
||||
* 6. has an end position.
|
||||
*/
|
||||
export declare function isToken(x: any): x is CSSToken;
|
||||
|
||||
export declare function isTokenAtKeyword(x?: CSSToken | null): x is TokenAtKeyword;
|
||||
|
||||
export declare function isTokenBadString(x?: CSSToken | null): x is TokenBadString;
|
||||
|
||||
export declare function isTokenBadURL(x?: CSSToken | null): x is TokenBadURL;
|
||||
|
||||
export declare function isTokenCDC(x?: CSSToken | null): x is TokenCDC;
|
||||
|
||||
export declare function isTokenCDO(x?: CSSToken | null): x is TokenCDO;
|
||||
|
||||
export declare function isTokenCloseCurly(x?: CSSToken | null): x is TokenCloseCurly;
|
||||
|
||||
export declare function isTokenCloseParen(x?: CSSToken | null): x is TokenCloseParen;
|
||||
|
||||
export declare function isTokenCloseSquare(x?: CSSToken | null): x is TokenCloseSquare;
|
||||
|
||||
export declare function isTokenColon(x?: CSSToken | null): x is TokenColon;
|
||||
|
||||
export declare function isTokenComma(x?: CSSToken | null): x is TokenComma;
|
||||
|
||||
export declare function isTokenComment(x?: CSSToken | null): x is TokenComment;
|
||||
|
||||
export declare function isTokenDelim(x?: CSSToken | null): x is TokenDelim;
|
||||
|
||||
export declare function isTokenDimension(x?: CSSToken | null): x is TokenDimension;
|
||||
|
||||
export declare function isTokenEOF(x?: CSSToken | null): x is TokenEOF;
|
||||
|
||||
export declare function isTokenFunction(x?: CSSToken | null): x is TokenFunction;
|
||||
|
||||
export declare function isTokenHash(x?: CSSToken | null): x is TokenHash;
|
||||
|
||||
export declare function isTokenIdent(x?: CSSToken | null): x is TokenIdent;
|
||||
|
||||
export declare function isTokenNumber(x?: CSSToken | null): x is TokenNumber;
|
||||
|
||||
/**
|
||||
* Assert that a token is a numeric token
|
||||
*/
|
||||
export declare function isTokenNumeric(x?: CSSToken | null): x is NumericToken;
|
||||
|
||||
export declare function isTokenOpenCurly(x?: CSSToken | null): x is TokenOpenCurly;
|
||||
|
||||
export declare function isTokenOpenParen(x?: CSSToken | null): x is TokenOpenParen;
|
||||
|
||||
export declare function isTokenOpenSquare(x?: CSSToken | null): x is TokenOpenSquare;
|
||||
|
||||
export declare function isTokenPercentage(x?: CSSToken | null): x is TokenPercentage;
|
||||
|
||||
export declare function isTokenSemicolon(x?: CSSToken | null): x is TokenSemicolon;
|
||||
|
||||
export declare function isTokenString(x?: CSSToken | null): x is TokenString;
|
||||
|
||||
export declare function isTokenUnicodeRange(x?: CSSToken | null): x is TokenUnicodeRange;
|
||||
|
||||
export declare function isTokenURL(x?: CSSToken | null): x is TokenURL;
|
||||
|
||||
export declare function isTokenWhitespace(x?: CSSToken | null): x is TokenWhitespace;
|
||||
|
||||
/**
|
||||
* Assert that a token is a whitespace or comment token
|
||||
*/
|
||||
export declare function isTokenWhiteSpaceOrComment(x?: CSSToken | null): x is TokenWhitespace | TokenComment;
|
||||
|
||||
/**
|
||||
* Get the mirror variant of a given token
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const input = [TokenType.OpenParen, '(', 0, 1, undefined];
|
||||
* const output = mirrorVariant(input);
|
||||
*
|
||||
* console.log(output); // [TokenType.CloseParen, ')', -1, -1, undefined]
|
||||
* ```
|
||||
*/
|
||||
export declare function mirrorVariant(token: CSSToken): CSSToken | null;
|
||||
|
||||
/**
|
||||
* Get the mirror variant type of a given token type
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const input = TokenType.OpenParen;
|
||||
* const output = mirrorVariantType(input);
|
||||
*
|
||||
* console.log(output); // TokenType.CloseParen
|
||||
* ```
|
||||
*/
|
||||
export declare function mirrorVariantType(type: TokenType): TokenType | null;
|
||||
|
||||
/**
|
||||
* Set the ident value and update the string representation.
|
||||
* This handles escaping.
|
||||
*/
|
||||
export declare function mutateIdent(ident: TokenIdent, newValue: string): void;
|
||||
|
||||
/**
|
||||
* Set the unit and update the string representation.
|
||||
* This handles escaping.
|
||||
*/
|
||||
export declare function mutateUnit(ident: TokenDimension, newUnit: string): void;
|
||||
|
||||
/**
|
||||
* The type of number token
|
||||
* Either `integer` or `number`
|
||||
*/
|
||||
export declare enum NumberType {
|
||||
Integer = "integer",
|
||||
Number = "number"
|
||||
}
|
||||
|
||||
/**
|
||||
* The union of all possible CSS tokens that represent a numeric value
|
||||
*/
|
||||
export declare type NumericToken = TokenDimension | TokenNumber | TokenPercentage;
|
||||
|
||||
/**
|
||||
* The CSS Tokenizer is forgiving and will never throw on invalid input.
|
||||
* Any errors are reported through the `onParseError` callback.
|
||||
*/
|
||||
export declare class ParseError extends Error {
|
||||
/** The index of the start character of the current token. */
|
||||
sourceStart: number;
|
||||
/** The index of the end character of the current token. */
|
||||
sourceEnd: number;
|
||||
/** The parser steps that preceded the error. */
|
||||
parserState: Array<string>;
|
||||
constructor(message: string, sourceStart: number, sourceEnd: number, parserState: Array<string>);
|
||||
}
|
||||
|
||||
export declare const ParseErrorMessage: {
|
||||
UnexpectedNewLineInString: string;
|
||||
UnexpectedEOFInString: string;
|
||||
UnexpectedEOFInComment: string;
|
||||
UnexpectedEOFInURL: string;
|
||||
UnexpectedEOFInEscapedCodePoint: string;
|
||||
UnexpectedCharacterInURL: string;
|
||||
InvalidEscapeSequenceInURL: string;
|
||||
InvalidEscapeSequenceAfterBackslash: string;
|
||||
};
|
||||
|
||||
export declare class ParseErrorWithToken extends ParseError {
|
||||
/** The associated token. */
|
||||
token: CSSToken;
|
||||
constructor(message: string, sourceStart: number, sourceEnd: number, parserState: Array<string>, token: CSSToken);
|
||||
}
|
||||
|
||||
/**
|
||||
* Concatenate the string representation of a list of tokens.
|
||||
* This is not a proper serializer that will handle escaping and whitespace.
|
||||
* It only produces valid CSS for a token list that is also valid.
|
||||
*/
|
||||
export declare function stringify(...tokens: Array<CSSToken>): string;
|
||||
|
||||
/**
|
||||
* The CSS Token interface
|
||||
*
|
||||
* @remarks
|
||||
* CSS Tokens are fully typed and have a strict structure.
|
||||
* This makes it easier to iterate and analyze a token stream.
|
||||
*
|
||||
* The string representation and the parsed value are stored separately for many token types.
|
||||
* It is always assumed that the string representation will be used when stringifying, while the parsed value should be used when analyzing tokens.
|
||||
*/
|
||||
export declare interface Token<T extends TokenType, U> extends Array<T | string | number | U> {
|
||||
/**
|
||||
* The type of token
|
||||
*/
|
||||
0: T;
|
||||
/**
|
||||
* The token representation
|
||||
*
|
||||
* @remarks
|
||||
* This field will be used when stringifying the token.
|
||||
* Any stored value is assumed to be valid CSS.
|
||||
*
|
||||
* You should never use this field when analyzing the token when there is a parsed value available.
|
||||
* But you must store mutated values here.
|
||||
*/
|
||||
1: string;
|
||||
/**
|
||||
* Start position of representation
|
||||
*/
|
||||
2: number;
|
||||
/**
|
||||
* End position of representation
|
||||
*/
|
||||
3: number;
|
||||
/**
|
||||
* Extra data
|
||||
*
|
||||
* @remarks
|
||||
* This holds the parsed value of each token.
|
||||
* These values are unescaped, unquoted, converted to numbers, etc.
|
||||
*
|
||||
* You should always use this field when analyzing the token.
|
||||
* But you must not assume that mutating only this field will have any effect.
|
||||
*/
|
||||
4: U;
|
||||
}
|
||||
|
||||
export declare interface TokenAtKeyword extends Token<TokenType.AtKeyword, {
|
||||
/**
|
||||
* The unescaped at-keyword name without the leading `@`.
|
||||
*/
|
||||
value: string;
|
||||
}> {
|
||||
}
|
||||
|
||||
export declare interface TokenBadString extends Token<TokenType.BadString, undefined> {
|
||||
}
|
||||
|
||||
export declare interface TokenBadURL extends Token<TokenType.BadURL, undefined> {
|
||||
}
|
||||
|
||||
export declare interface TokenCDC extends Token<TokenType.CDC, undefined> {
|
||||
}
|
||||
|
||||
export declare interface TokenCDO extends Token<TokenType.CDO, undefined> {
|
||||
}
|
||||
|
||||
export declare interface TokenCloseCurly extends Token<TokenType.CloseCurly, undefined> {
|
||||
}
|
||||
|
||||
export declare interface TokenCloseParen extends Token<TokenType.CloseParen, undefined> {
|
||||
}
|
||||
|
||||
export declare interface TokenCloseSquare extends Token<TokenType.CloseSquare, undefined> {
|
||||
}
|
||||
|
||||
export declare interface TokenColon extends Token<TokenType.Colon, undefined> {
|
||||
}
|
||||
|
||||
export declare interface TokenComma extends Token<TokenType.Comma, undefined> {
|
||||
}
|
||||
|
||||
export declare interface TokenComment extends Token<TokenType.Comment, undefined> {
|
||||
}
|
||||
|
||||
export declare interface TokenDelim extends Token<TokenType.Delim, {
|
||||
/**
|
||||
* The delim character.
|
||||
*/
|
||||
value: string;
|
||||
}> {
|
||||
}
|
||||
|
||||
export declare interface TokenDimension extends Token<TokenType.Dimension, {
|
||||
/**
|
||||
* The numeric value.
|
||||
*/
|
||||
value: number;
|
||||
/**
|
||||
* The unescaped unit name.
|
||||
*/
|
||||
unit: string;
|
||||
/**
|
||||
* `integer` or `number`
|
||||
*/
|
||||
type: NumberType;
|
||||
/**
|
||||
* The sign character as it appeared in the source.
|
||||
* This is only useful if you need to determine if a value was written as "2px" or "+2px".
|
||||
*/
|
||||
signCharacter?: '+' | '-';
|
||||
}> {
|
||||
}
|
||||
|
||||
export declare interface TokenEOF extends Token<TokenType.EOF, undefined> {
|
||||
}
|
||||
|
||||
export declare interface TokenFunction extends Token<TokenType.Function, {
|
||||
/**
|
||||
* The unescaped function name without the trailing `(`.
|
||||
*/
|
||||
value: string;
|
||||
}> {
|
||||
}
|
||||
|
||||
export declare interface TokenHash extends Token<TokenType.Hash, {
|
||||
/**
|
||||
* The unescaped hash value without the leading `#`.
|
||||
*/
|
||||
value: string;
|
||||
/**
|
||||
* The hash type.
|
||||
*/
|
||||
type: HashType;
|
||||
}> {
|
||||
}
|
||||
|
||||
export declare interface TokenIdent extends Token<TokenType.Ident, {
|
||||
/**
|
||||
* The unescaped ident value.
|
||||
*/
|
||||
value: string;
|
||||
}> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Tokenize a CSS string into a list of tokens.
|
||||
*/
|
||||
export declare function tokenize(input: {
|
||||
css: {
|
||||
valueOf(): string;
|
||||
};
|
||||
unicodeRangesAllowed?: boolean;
|
||||
}, options?: {
|
||||
onParseError?: (error: ParseError) => void;
|
||||
}): Array<CSSToken>;
|
||||
|
||||
/**
|
||||
* Create a tokenizer for a CSS string.
|
||||
*/
|
||||
export declare function tokenizer(input: {
|
||||
css: {
|
||||
valueOf(): string;
|
||||
};
|
||||
unicodeRangesAllowed?: boolean;
|
||||
}, options?: {
|
||||
onParseError?: (error: ParseError) => void;
|
||||
}): {
|
||||
nextToken: () => CSSToken;
|
||||
endOfFile: () => boolean;
|
||||
};
|
||||
|
||||
export declare interface TokenNumber extends Token<TokenType.Number, {
|
||||
/**
|
||||
* The numeric value.
|
||||
*/
|
||||
value: number;
|
||||
/**
|
||||
* `integer` or `number`
|
||||
*/
|
||||
type: NumberType;
|
||||
/**
|
||||
* The sign character as it appeared in the source.
|
||||
* This is only useful if you need to determine if a value was written as "2" or "+2".
|
||||
*/
|
||||
signCharacter?: '+' | '-';
|
||||
}> {
|
||||
}
|
||||
|
||||
export declare interface TokenOpenCurly extends Token<TokenType.OpenCurly, undefined> {
|
||||
}
|
||||
|
||||
export declare interface TokenOpenParen extends Token<TokenType.OpenParen, undefined> {
|
||||
}
|
||||
|
||||
export declare interface TokenOpenSquare extends Token<TokenType.OpenSquare, undefined> {
|
||||
}
|
||||
|
||||
export declare interface TokenPercentage extends Token<TokenType.Percentage, {
|
||||
/**
|
||||
* The numeric value.
|
||||
*/
|
||||
value: number;
|
||||
/**
|
||||
* The sign character as it appeared in the source.
|
||||
* This is only useful if you need to determine if a value was written as "2%" or "+2%".
|
||||
*/
|
||||
signCharacter?: '+' | '-';
|
||||
}> {
|
||||
}
|
||||
|
||||
export declare interface TokenSemicolon extends Token<TokenType.Semicolon, undefined> {
|
||||
}
|
||||
|
||||
export declare interface TokenString extends Token<TokenType.String, {
|
||||
/**
|
||||
* The unescaped string value without the leading and trailing quotes.
|
||||
*/
|
||||
value: string;
|
||||
}> {
|
||||
}
|
||||
|
||||
/**
|
||||
* All possible CSS token types
|
||||
*/
|
||||
export declare enum TokenType {
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#comment-diagram}
|
||||
*/
|
||||
Comment = "comment",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-at-keyword-token}
|
||||
*/
|
||||
AtKeyword = "at-keyword-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-bad-string-token}
|
||||
*/
|
||||
BadString = "bad-string-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-bad-url-token}
|
||||
*/
|
||||
BadURL = "bad-url-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-cdc-token}
|
||||
*/
|
||||
CDC = "CDC-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-cdo-token}
|
||||
*/
|
||||
CDO = "CDO-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-colon-token}
|
||||
*/
|
||||
Colon = "colon-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-comma-token}
|
||||
*/
|
||||
Comma = "comma-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-delim-token}
|
||||
*/
|
||||
Delim = "delim-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-dimension-token}
|
||||
*/
|
||||
Dimension = "dimension-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-eof-token}
|
||||
*/
|
||||
EOF = "EOF-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-function-token}
|
||||
*/
|
||||
Function = "function-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-hash-token}
|
||||
*/
|
||||
Hash = "hash-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-ident-token}
|
||||
*/
|
||||
Ident = "ident-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-percentage-token}
|
||||
*/
|
||||
Number = "number-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-percentage-token}
|
||||
*/
|
||||
Percentage = "percentage-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-semicolon-token}
|
||||
*/
|
||||
Semicolon = "semicolon-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-string-token}
|
||||
*/
|
||||
String = "string-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-url-token}
|
||||
*/
|
||||
URL = "url-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-whitespace-token}
|
||||
*/
|
||||
Whitespace = "whitespace-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-open-paren}
|
||||
*/
|
||||
OpenParen = "(-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-close-paren}
|
||||
*/
|
||||
CloseParen = ")-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-open-square}
|
||||
*/
|
||||
OpenSquare = "[-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-close-square}
|
||||
*/
|
||||
CloseSquare = "]-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-open-curly}
|
||||
*/
|
||||
OpenCurly = "{-token",
|
||||
/**
|
||||
* @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-close-curly}
|
||||
*/
|
||||
CloseCurly = "}-token",
|
||||
/**
|
||||
* Only appears in the token stream when the `unicodeRangesAllowed` option is set to true.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* import { tokenize } from '@csstools/css-tokenizer';
|
||||
*
|
||||
* const tokens = tokenize({
|
||||
* css: `U+0025-00FF, U+4??`,
|
||||
* unicodeRangesAllowed: true,
|
||||
* });
|
||||
*
|
||||
* console.log(tokens);
|
||||
* ```
|
||||
*
|
||||
* @see {@link https://drafts.csswg.org/css-syntax/#typedef-unicode-range-token}
|
||||
*/
|
||||
UnicodeRange = "unicode-range-token"
|
||||
}
|
||||
|
||||
export declare interface TokenUnicodeRange extends Token<TokenType.UnicodeRange, {
|
||||
startOfRange: number;
|
||||
endOfRange: number;
|
||||
}> {
|
||||
}
|
||||
|
||||
export declare interface TokenURL extends Token<TokenType.URL, {
|
||||
/**
|
||||
* The unescaped URL value without the leading `url(` and trailing `)`.
|
||||
*/
|
||||
value: string;
|
||||
}> {
|
||||
}
|
||||
|
||||
export declare interface TokenWhitespace extends Token<TokenType.Whitespace, undefined> {
|
||||
}
|
||||
|
||||
export { }
|
||||
1
node_modules/@csstools/css-tokenizer/dist/index.mjs
generated
vendored
Normal file
1
node_modules/@csstools/css-tokenizer/dist/index.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
55
node_modules/@csstools/css-tokenizer/package.json
generated
vendored
Normal file
55
node_modules/@csstools/css-tokenizer/package.json
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"name": "@csstools/css-tokenizer",
|
||||
"description": "Tokenize CSS",
|
||||
"version": "4.0.0",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Antonio Laguna",
|
||||
"email": "antonio@laguna.es",
|
||||
"url": "https://antonio.laguna.es"
|
||||
},
|
||||
{
|
||||
"name": "Romain Menke",
|
||||
"email": "romainmenke@gmail.com"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/csstools"
|
||||
},
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/csstools"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.19.0"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.mjs"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"CHANGELOG.md",
|
||||
"LICENSE.md",
|
||||
"README.md",
|
||||
"dist"
|
||||
],
|
||||
"scripts": {},
|
||||
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/csstools/postcss-plugins.git",
|
||||
"directory": "packages/css-tokenizer"
|
||||
},
|
||||
"bugs": "https://github.com/csstools/postcss-plugins/issues",
|
||||
"keywords": [
|
||||
"css",
|
||||
"tokenizer"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user