@csstools/postcss-color-function 3.0.16 → 3.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changes to PostCSS Color Function
2
2
 
3
+ ### 3.0.17
4
+
5
+ _June 29, 2024_
6
+
7
+ - Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#232) (patch)
8
+ - Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.7.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#270) (minor)
9
+ - Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#203) (patch)
10
+
3
11
  ### 3.0.16
4
12
 
5
13
  _May 4, 2024_
@@ -16,10 +24,4 @@ _May 4, 2024_
16
24
  - Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#262) (patch)
17
25
  - Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#201) (patch)
18
26
 
19
- ### 3.0.14
20
-
21
- _April 21, 2024_
22
-
23
- - Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#200) (major)
24
-
25
27
  [Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-function/CHANGELOG.md)
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var s=require("@csstools/postcss-progressive-custom-properties"),e=require("@csstools/css-tokenizer"),o=require("@csstools/css-color-parser"),r=require("@csstools/utilities"),t=require("@csstools/css-parser-algorithms");const a=/\b(?:color)\(/i,n=/^(?:color)$/i,basePlugin=s=>({postcssPlugin:"postcss-color-function",Declaration(i){const c=i.value;if(!a.test(c))return;if(r.hasFallback(i))return;if(r.hasSupportsAtRuleAncestor(i,a))return;const l=e.tokenize({css:c}),u=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(l),(s=>{if(!t.isFunctionNode(s)||!n.test(s.getName()))return;const e=o.color(s);return e&&!(e.syntaxFlags.has(o.SyntaxFlag.Experimental)||e.syntaxFlags.has(o.SyntaxFlag.HasNoneKeywords)||e.syntaxFlags.has(o.SyntaxFlag.RelativeColorSyntax))?o.serializeRGB(e):void 0})),p=t.stringify(u);p!==c&&(i.cloneBefore({value:p}),s?.preserve||i.remove())}});basePlugin.postcss=!0;const postcssPlugin=e=>{const o=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},e);return o.enableProgressiveCustomProperties&&o.preserve?{postcssPlugin:"postcss-color-function",plugins:[s(),basePlugin(o)]}:basePlugin(o)};postcssPlugin.postcss=!0,module.exports=postcssPlugin;
1
+ "use strict";var s=require("@csstools/postcss-progressive-custom-properties"),e=require("@csstools/css-tokenizer"),o=require("@csstools/css-color-parser"),r=require("@csstools/utilities"),t=require("@csstools/css-parser-algorithms");const a=/\bcolor\(/i,n=/^color$/i,basePlugin=s=>({postcssPlugin:"postcss-color-function",Declaration(i){const c=i.value;if(!a.test(c))return;if(r.hasFallback(i))return;if(r.hasSupportsAtRuleAncestor(i,a))return;const l=e.tokenize({css:c}),u=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(l),(s=>{if(!t.isFunctionNode(s)||!n.test(s.getName()))return;const e=o.color(s);return e&&!(e.syntaxFlags.has(o.SyntaxFlag.Experimental)||e.syntaxFlags.has(o.SyntaxFlag.HasNoneKeywords)||e.syntaxFlags.has(o.SyntaxFlag.RelativeColorSyntax))?o.serializeRGB(e):void 0})),p=t.stringify(u);p!==c&&(i.cloneBefore({value:p}),s?.preserve||i.remove())}});basePlugin.postcss=!0;const postcssPlugin=e=>{const o=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},e);return o.enableProgressiveCustomProperties&&o.preserve?{postcssPlugin:"postcss-color-function",plugins:[s(),basePlugin(o)]}:basePlugin(o)};postcssPlugin.postcss=!0,module.exports=postcssPlugin;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as o}from"@csstools/css-tokenizer";import{color as r,SyntaxFlag as e,serializeRGB as t}from"@csstools/css-color-parser";import{hasFallback as c,hasSupportsAtRuleAncestor as i}from"@csstools/utilities";import{replaceComponentValues as n,parseCommaSeparatedListOfComponentValues as l,isFunctionNode as a,stringify as p}from"@csstools/css-parser-algorithms";const u=/\b(?:color)\(/i,m=/^(?:color)$/i,basePlugin=s=>({postcssPlugin:"postcss-color-function",Declaration(f){const g=f.value;if(!u.test(g))return;if(c(f))return;if(i(f,u))return;const v=o({css:g}),x=n(l(v),(s=>{if(!a(s)||!m.test(s.getName()))return;const o=r(s);return o&&!(o.syntaxFlags.has(e.Experimental)||o.syntaxFlags.has(e.HasNoneKeywords)||o.syntaxFlags.has(e.RelativeColorSyntax))?t(o):void 0})),P=p(x);P!==g&&(f.cloneBefore({value:P}),s?.preserve||f.remove())}});basePlugin.postcss=!0;const postcssPlugin=o=>{const r=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},o);return r.enableProgressiveCustomProperties&&r.preserve?{postcssPlugin:"postcss-color-function",plugins:[s(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default};
1
+ import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as o}from"@csstools/css-tokenizer";import{color as r,SyntaxFlag as e,serializeRGB as t}from"@csstools/css-color-parser";import{hasFallback as c,hasSupportsAtRuleAncestor as i}from"@csstools/utilities";import{replaceComponentValues as n,parseCommaSeparatedListOfComponentValues as l,isFunctionNode as a,stringify as p}from"@csstools/css-parser-algorithms";const u=/\bcolor\(/i,m=/^color$/i,basePlugin=s=>({postcssPlugin:"postcss-color-function",Declaration(f){const g=f.value;if(!u.test(g))return;if(c(f))return;if(i(f,u))return;const v=o({css:g}),x=n(l(v),(s=>{if(!a(s)||!m.test(s.getName()))return;const o=r(s);return o&&!(o.syntaxFlags.has(e.Experimental)||o.syntaxFlags.has(e.HasNoneKeywords)||o.syntaxFlags.has(e.RelativeColorSyntax))?t(o):void 0})),P=p(x);P!==g&&(f.cloneBefore({value:P}),s?.preserve||f.remove())}});basePlugin.postcss=!0;const postcssPlugin=o=>{const r=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},o);return r.enableProgressiveCustomProperties&&r.preserve?{postcssPlugin:"postcss-color-function",plugins:[s(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@csstools/postcss-color-function",
3
3
  "description": "Use the color() function in CSS",
4
- "version": "3.0.16",
4
+ "version": "3.0.17",
5
5
  "author": "Jonathan Neal <jonathantneal@hotmail.com>",
6
6
  "license": "MIT-0",
7
7
  "funding": [
@@ -38,15 +38,16 @@
38
38
  "dist"
39
39
  ],
40
40
  "dependencies": {
41
- "@csstools/css-color-parser": "^2.0.2",
42
- "@csstools/css-parser-algorithms": "^2.6.3",
43
- "@csstools/css-tokenizer": "^2.3.1",
41
+ "@csstools/css-color-parser": "^2.0.3",
42
+ "@csstools/css-parser-algorithms": "^2.7.0",
43
+ "@csstools/css-tokenizer": "^2.3.2",
44
44
  "@csstools/postcss-progressive-custom-properties": "^3.2.0",
45
45
  "@csstools/utilities": "^1.0.0"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "postcss": "^8.4"
49
49
  },
50
+ "scripts": {},
50
51
  "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-function#readme",
51
52
  "repository": {
52
53
  "type": "git",