summaryrefslogtreecommitdiff
path: root/node_modules/@csstools/postcss-hwb-function
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@csstools/postcss-hwb-function')
-rw-r--r--node_modules/@csstools/postcss-hwb-function/CHANGELOG.md109
-rw-r--r--node_modules/@csstools/postcss-hwb-function/dist/has-fallback-decl.d.ts2
-rw-r--r--node_modules/@csstools/postcss-hwb-function/dist/has-supports-at-rule-ancestor.d.ts3
-rw-r--r--node_modules/@csstools/postcss-hwb-function/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-hwb-function/dist/index.d.ts6
-rw-r--r--node_modules/@csstools/postcss-hwb-function/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-hwb-function/package.json41
7 files changed, 30 insertions, 135 deletions
diff --git a/node_modules/@csstools/postcss-hwb-function/CHANGELOG.md b/node_modules/@csstools/postcss-hwb-function/CHANGELOG.md
index d3d6844f..ef182ca8 100644
--- a/node_modules/@csstools/postcss-hwb-function/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-hwb-function/CHANGELOG.md
@@ -1,5 +1,14 @@
# Changes to PostCSS HWB Function
+### 3.0.7
+
+_December 15, 2023_
+
+- Skip transforms when a color value contains experimental syntax
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#150) (minor)
+
### 3.0.6
_October 9, 2023_
@@ -12,102 +21,4 @@ _October 2, 2023_
- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#133) (patch)
-### 3.0.4
-
-_September 24, 2023_
-
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#232) (patch)
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#132) (patch)
-
-### 3.0.3
-
-_September 2, 2023_
-
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#131) (patch)
-
-### 3.0.2
-
-_August 28, 2023_
-
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#130) (minor)
-
-### 3.0.1
-
-_July 24, 2023_
-
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#220) (minor)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#231) (patch)
-
-### 3.0.0
-
-_July 3, 2023_
-
-- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/))
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#230) (minor)
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#122) (patch)
-
-### 2.2.2
-
-_May 19, 2023_
-
-- Ignore relative color syntax
-- Updated `@csstools/css-color-parser` to `1.2.0` (minor)
-
-
-### 2.2.1
-
-_April 10, 2023_
-
-- Updated `@csstools/css-tokenizer` to `2.1.1` (patch)
-- Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch)
-- Updated `@csstools/css-color-parser` to `1.1.2` (patch)
-
-### 2.2.0
-
-_March 25, 2023_
-
-- Add `@csstools/css-color-parser` dependency for all color value transformations.
-- Add support for `calc` expressions in color components.
-
-### 2.1.1
-
-_February 8, 2023_
-
-- Reduce the amount of duplicate fallback CSS.
-
-### 2.1.0
-
-_February 2, 2023_
-
-- Add: `@csstools/color-helpers` dependency for all color value transformations.
-
-### 2.0.1
-
-_January 28, 2023_
-
-- Improve `types` declaration in `package.json`
-
-### 2.0.0
-
-_January 24, 2023_
-
-- Updated: Support for Node v14+ (major).
-
-### 1.0.2
-
-_July 8, 2022_
-
-- Fix case insensitive matching.
-
-### 1.0.1
-
-_May 18, 2022_
-
-- Fix grayscale conversions.
-
-### 1.0.0
-
-_January 22, 2022_
-
-- Initial version
+[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-hwb-function/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-hwb-function/dist/has-fallback-decl.d.ts b/node_modules/@csstools/postcss-hwb-function/dist/has-fallback-decl.d.ts
deleted file mode 100644
index d7ae8d89..00000000
--- a/node_modules/@csstools/postcss-hwb-function/dist/has-fallback-decl.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-import type { Declaration } from 'postcss';
-export declare function hasFallback(node: Declaration): boolean;
diff --git a/node_modules/@csstools/postcss-hwb-function/dist/has-supports-at-rule-ancestor.d.ts b/node_modules/@csstools/postcss-hwb-function/dist/has-supports-at-rule-ancestor.d.ts
deleted file mode 100644
index 7fbe0b29..00000000
--- a/node_modules/@csstools/postcss-hwb-function/dist/has-supports-at-rule-ancestor.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import type { Node } from 'postcss';
-export declare const atSupportsHwbParams = "(color: hwb(0 0% 0%))";
-export declare function hasSupportsAtRuleAncestor(node: Node): boolean;
diff --git a/node_modules/@csstools/postcss-hwb-function/dist/index.cjs b/node_modules/@csstools/postcss-hwb-function/dist/index.cjs
index 19fafe2e..9e4a79aa 100644
--- a/node_modules/@csstools/postcss-hwb-function/dist/index.cjs
+++ b/node_modules/@csstools/postcss-hwb-function/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("@csstools/css-color-parser"),t=require("@csstools/css-parser-algorithms"),r=require("@csstools/css-tokenizer");const s="(color: hwb(0 0% 0%))";function hasSupportsAtRuleAncestor(e){let t=e.parent;for(;t;)if("atrule"===t.type){if("supports"===t.name.toLowerCase()&&t.params.includes(s))return!0;t=t.parent}else t=t.parent;return!1}function hasFallback(e){const t=e.parent;if(!t)return!1;const r=e.prop.toLowerCase(),s=t.index(e);for(let e=0;e<s;e++){const s=t.nodes[e];if("decl"===s.type&&s.prop.toLowerCase()===r)return!0}return!1}const o=/hwb\(/i,n=/^hwb$/i,postcssPlugin=a=>{const l="preserve"in Object(a)&&Boolean(null==a?void 0:a.preserve);return{postcssPlugin:"postcss-hwb-function",Declaration:(a,{postcss:c})=>{const p=a.value;if(!o.test(p))return;if(l&&hasSupportsAtRuleAncestor(a))return;if(hasFallback(a))return;const u=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(r.tokenize({css:p})),(r=>{if(t.isFunctionNode(r)&&n.test(r.getName())){const t=e.color(r);if(!t)return;if(t.syntaxFlags.has(e.SyntaxFlag.HasNoneKeywords))return;if(t.syntaxFlags.has(e.SyntaxFlag.RelativeColorSyntax))return;return e.serializeRGB(t)}})),i=t.stringify(u);if(i!==p)if(a.variable&&l&&a.parent){const e=a.parent,t=c.atRule({name:"supports",params:s,source:a.source}),r=e.clone();r.removeAll(),r.append(a.clone()),t.append(r),insertAtSupportsAfterCorrectRule(t,e,s),a.replaceWith(a.clone({value:i}))}else l?a.cloneBefore({value:i}):a.replaceWith(a.clone({value:i}))}}};function insertAtSupportsAfterCorrectRule(e,t,r){let s=t,o=t.next();for(;s&&o&&"atrule"===o.type&&"supports"===o.name.toLowerCase()&&o.params===r;)s=o,o=o.next();s.after(e)}postcssPlugin.postcss=!0,module.exports=postcssPlugin;
+"use strict";var e=require("@csstools/css-color-parser"),t=require("@csstools/css-parser-algorithms"),r=require("@csstools/css-tokenizer");const s="(color: hwb(0 0% 0%))";function hasSupportsAtRuleAncestor(e){let t=e.parent;for(;t;)if("atrule"===t.type){if("supports"===t.name.toLowerCase()&&t.params.includes(s))return!0;t=t.parent}else t=t.parent;return!1}function hasFallback(e){const t=e.parent;if(!t)return!1;const r=e.prop.toLowerCase(),s=t.index(e);for(let e=0;e<s;e++){const s=t.nodes[e];if("decl"===s.type&&s.prop.toLowerCase()===r)return!0}return!1}const o=/hwb\(/i,n=/^hwb$/i,postcssPlugin=a=>{const l="preserve"in Object(a)&&Boolean(a?.preserve);return{postcssPlugin:"postcss-hwb-function",Declaration:(a,{postcss:p})=>{const c=a.value;if(!o.test(c))return;if(l&&hasSupportsAtRuleAncestor(a))return;if(hasFallback(a))return;const u=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(r.tokenize({css:c})),(r=>{if(t.isFunctionNode(r)&&n.test(r.getName())){const t=e.color(r);if(!t)return;if(t.syntaxFlags.has(e.SyntaxFlag.Experimental))return;if(t.syntaxFlags.has(e.SyntaxFlag.HasNoneKeywords))return;if(t.syntaxFlags.has(e.SyntaxFlag.RelativeColorSyntax))return;return e.serializeRGB(t)}})),i=t.stringify(u);if(i!==c)if(a.variable&&l&&a.parent){const e=a.parent,t=p.atRule({name:"supports",params:s,source:a.source}),r=e.clone();r.removeAll(),r.append(a.clone()),t.append(r),insertAtSupportsAfterCorrectRule(t,e,s),a.replaceWith(a.clone({value:i}))}else l?a.cloneBefore({value:i}):a.replaceWith(a.clone({value:i}))}}};function insertAtSupportsAfterCorrectRule(e,t,r){let s=t,o=t.next();for(;s&&o&&"atrule"===o.type&&"supports"===o.name.toLowerCase()&&o.params===r;)s=o,o=o.next();s.after(e)}postcssPlugin.postcss=!0,module.exports=postcssPlugin;
diff --git a/node_modules/@csstools/postcss-hwb-function/dist/index.d.ts b/node_modules/@csstools/postcss-hwb-function/dist/index.d.ts
index 0304f878..d469e87a 100644
--- a/node_modules/@csstools/postcss-hwb-function/dist/index.d.ts
+++ b/node_modules/@csstools/postcss-hwb-function/dist/index.d.ts
@@ -1,9 +1,13 @@
import type { PluginCreator } from 'postcss';
+
/** postcss-hwb-function plugin options */
-export type pluginOptions = {
+export declare type pluginOptions = {
/** Preserve the original notation. default: false */
preserve?: boolean;
};
+
/** Transform hwb() functions in CSS. */
declare const postcssPlugin: PluginCreator<pluginOptions>;
export default postcssPlugin;
+
+export { }
diff --git a/node_modules/@csstools/postcss-hwb-function/dist/index.mjs b/node_modules/@csstools/postcss-hwb-function/dist/index.mjs
index 067e6891..a8603a7a 100644
--- a/node_modules/@csstools/postcss-hwb-function/dist/index.mjs
+++ b/node_modules/@csstools/postcss-hwb-function/dist/index.mjs
@@ -1 +1 @@
-import{color as e,SyntaxFlag as t,serializeRGB as r}from"@csstools/css-color-parser";import{replaceComponentValues as s,parseCommaSeparatedListOfComponentValues as o,isFunctionNode as n,stringify as a}from"@csstools/css-parser-algorithms";import{tokenize as l}from"@csstools/css-tokenizer";const p="(color: hwb(0 0% 0%))";function hasSupportsAtRuleAncestor(e){let t=e.parent;for(;t;)if("atrule"===t.type){if("supports"===t.name.toLowerCase()&&t.params.includes(p))return!0;t=t.parent}else t=t.parent;return!1}function hasFallback(e){const t=e.parent;if(!t)return!1;const r=e.prop.toLowerCase(),s=t.index(e);for(let e=0;e<s;e++){const s=t.nodes[e];if("decl"===s.type&&s.prop.toLowerCase()===r)return!0}return!1}const c=/hwb\(/i,u=/^hwb$/i,postcssPlugin=i=>{const f="preserve"in Object(i)&&Boolean(null==i?void 0:i.preserve);return{postcssPlugin:"postcss-hwb-function",Declaration:(i,{postcss:m})=>{const h=i.value;if(!c.test(h))return;if(f&&hasSupportsAtRuleAncestor(i))return;if(hasFallback(i))return;const v=s(o(l({css:h})),(s=>{if(n(s)&&u.test(s.getName())){const o=e(s);if(!o)return;if(o.syntaxFlags.has(t.HasNoneKeywords))return;if(o.syntaxFlags.has(t.RelativeColorSyntax))return;return r(o)}})),d=a(v);if(d!==h)if(i.variable&&f&&i.parent){const e=i.parent,t=m.atRule({name:"supports",params:p,source:i.source}),r=e.clone();r.removeAll(),r.append(i.clone()),t.append(r),insertAtSupportsAfterCorrectRule(t,e,p),i.replaceWith(i.clone({value:d}))}else f?i.cloneBefore({value:d}):i.replaceWith(i.clone({value:d}))}}};function insertAtSupportsAfterCorrectRule(e,t,r){let s=t,o=t.next();for(;s&&o&&"atrule"===o.type&&"supports"===o.name.toLowerCase()&&o.params===r;)s=o,o=o.next();s.after(e)}postcssPlugin.postcss=!0;export{postcssPlugin as default};
+import{color as e,SyntaxFlag as t,serializeRGB as r}from"@csstools/css-color-parser";import{replaceComponentValues as s,parseCommaSeparatedListOfComponentValues as o,isFunctionNode as n,stringify as a}from"@csstools/css-parser-algorithms";import{tokenize as p}from"@csstools/css-tokenizer";const l="(color: hwb(0 0% 0%))";function hasSupportsAtRuleAncestor(e){let t=e.parent;for(;t;)if("atrule"===t.type){if("supports"===t.name.toLowerCase()&&t.params.includes(l))return!0;t=t.parent}else t=t.parent;return!1}function hasFallback(e){const t=e.parent;if(!t)return!1;const r=e.prop.toLowerCase(),s=t.index(e);for(let e=0;e<s;e++){const s=t.nodes[e];if("decl"===s.type&&s.prop.toLowerCase()===r)return!0}return!1}const c=/hwb\(/i,u=/^hwb$/i,postcssPlugin=i=>{const f="preserve"in Object(i)&&Boolean(i?.preserve);return{postcssPlugin:"postcss-hwb-function",Declaration:(i,{postcss:m})=>{const h=i.value;if(!c.test(h))return;if(f&&hasSupportsAtRuleAncestor(i))return;if(hasFallback(i))return;const v=s(o(p({css:h})),(s=>{if(n(s)&&u.test(s.getName())){const o=e(s);if(!o)return;if(o.syntaxFlags.has(t.Experimental))return;if(o.syntaxFlags.has(t.HasNoneKeywords))return;if(o.syntaxFlags.has(t.RelativeColorSyntax))return;return r(o)}})),w=a(v);if(w!==h)if(i.variable&&f&&i.parent){const e=i.parent,t=m.atRule({name:"supports",params:l,source:i.source}),r=e.clone();r.removeAll(),r.append(i.clone()),t.append(r),insertAtSupportsAfterCorrectRule(t,e,l),i.replaceWith(i.clone({value:w}))}else f?i.cloneBefore({value:w}):i.replaceWith(i.clone({value:w}))}}};function insertAtSupportsAfterCorrectRule(e,t,r){let s=t,o=t.next();for(;s&&o&&"atrule"===o.type&&"supports"===o.name.toLowerCase()&&o.params===r;)s=o,o=o.next();s.after(e)}postcssPlugin.postcss=!0;export{postcssPlugin as default};
diff --git a/node_modules/@csstools/postcss-hwb-function/package.json b/node_modules/@csstools/postcss-hwb-function/package.json
index de60d8d8..89ace0bb 100644
--- a/node_modules/@csstools/postcss-hwb-function/package.json
+++ b/node_modules/@csstools/postcss-hwb-function/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-hwb-function",
"description": "Use hwb() color functions in CSS",
- "version": "3.0.6",
+ "version": "3.0.7",
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
"license": "MIT-0",
"funding": [
@@ -17,15 +17,18 @@
"engines": {
"node": "^14 || ^16 || >=18"
},
+ "type": "module",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
- "types": "./dist/index.d.ts",
"exports": {
".": {
- "types": "./dist/index.d.ts",
- "import": "./dist/index.mjs",
- "require": "./dist/index.cjs",
- "default": "./dist/index.mjs"
+ "import": {
+ "types": "./dist/index.d.ts",
+ "default": "./dist/index.mjs"
+ },
+ "require": {
+ "default": "./dist/index.cjs"
+ }
}
},
"files": [
@@ -36,24 +39,13 @@
"dist"
],
"dependencies": {
- "@csstools/css-color-parser": "^1.4.0",
- "@csstools/css-parser-algorithms": "^2.3.2",
- "@csstools/css-tokenizer": "^2.2.1"
+ "@csstools/css-color-parser": "^1.5.0",
+ "@csstools/css-parser-algorithms": "^2.4.0",
+ "@csstools/css-tokenizer": "^2.2.2"
},
"peerDependencies": {
"postcss": "^8.4"
},
- "devDependencies": {
- "@csstools/postcss-tape": "*"
- },
- "scripts": {
- "build": "rollup -c ../../rollup/default.mjs",
- "docs": "node ../../.github/bin/generate-docs/install.mjs",
- "lint": "node ../../.github/bin/format-package-json.mjs",
- "prepublishOnly": "npm run build && npm run test",
- "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs",
- "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs"
- },
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-hwb-function#readme",
"repository": {
"type": "git",
@@ -77,12 +69,5 @@
"rgba",
"space",
"syntax"
- ],
- "csstools": {
- "exportName": "postcssHWBFunction",
- "humanReadableName": "PostCSS HWB Function"
- },
- "volta": {
- "extends": "../../package.json"
- }
+ ]
}