@csstools/postcss-hwb-function 4.0.12 → 5.0.0
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 +9 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +1 -1
- package/package.json +9 -16
- package/dist/index.cjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
# Changes to PostCSS HWB Function
|
|
2
2
|
|
|
3
|
-
###
|
|
3
|
+
### 5.0.0
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
_January 14, 2026_
|
|
6
6
|
|
|
7
|
-
- Updated
|
|
7
|
+
- Updated: Support for Node `20.19.0` or later (major).
|
|
8
|
+
- Removed: `commonjs` API. In supported Node versions `require(esm)` will work without needing to make code changes.
|
|
9
|
+
- 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)
|
|
10
|
+
- Updated [`@csstools/utilities`](https://github.com/csstools/postcss-plugins/tree/main/packages/utilities) to [`3.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/utilities/CHANGELOG.md#300) (major)
|
|
11
|
+
- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`4.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#400) (major)
|
|
12
|
+
- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`5.0.0`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#500) (major)
|
|
13
|
+
- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`4.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#400) (major)
|
|
8
14
|
|
|
9
15
|
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-hwb-function/CHANGELOG.md)
|
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import s from"@csstools/postcss-progressive-custom-properties";import{color as o,SyntaxFlag as e,serializeRGB as t}from"@csstools/css-color-parser";import{hasFallback as r,hasSupportsAtRuleAncestor as i}from"@csstools/utilities";import{replaceComponentValues as n,parseCommaSeparatedListOfComponentValues as c,isFunctionNode as a,stringify as p}from"@csstools/css-parser-algorithms";import{tokenize as l}from"@csstools/css-tokenizer";const u=/\bhwb\(/i,m=/^hwb$/i,basePlugin=s=>({postcssPlugin:"postcss-hwb-function",Declaration(f){const g=f.value;if(!u.test(g))return;if(r(f))return;if(i(f,u))return;const v=n(c(l({css:g})),s=>{if(!a(s)||!m.test(s.getName()))return;const r=o(s);return r&&!(r.syntaxFlags.has(e.Experimental)||r.syntaxFlags.has(e.HasNoneKeywords)||r.syntaxFlags.has(e.RelativeColorSyntax))?t(r):void 0}),b=p(v);b!==g&&(f.cloneBefore({value:b}),s?.preserve||f.remove())}});basePlugin.postcss=!0;const postcssPlugin=o=>{const e=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},o);return e.enableProgressiveCustomProperties&&e.preserve?{postcssPlugin:"postcss-hwb-function",plugins:[s(),basePlugin(e)]}:basePlugin(e)};postcssPlugin.postcss=!0;export{postcssPlugin as default};
|
|
1
|
+
import s from"@csstools/postcss-progressive-custom-properties";import{color as o,SyntaxFlag as e,serializeRGB as t}from"@csstools/css-color-parser";import{hasFallback as r,hasSupportsAtRuleAncestor as i}from"@csstools/utilities";import{replaceComponentValues as n,parseCommaSeparatedListOfComponentValues as c,isFunctionNode as a,stringify as p}from"@csstools/css-parser-algorithms";import{tokenize as l}from"@csstools/css-tokenizer";const u=/\bhwb\(/i,m=/^hwb$/i,basePlugin=s=>({postcssPlugin:"postcss-hwb-function",Declaration(f){const g=f.value;if(!u.test(g))return;if(r(f))return;if(i(f,u))return;const v=n(c(l({css:g})),s=>{if(!a(s)||!m.test(s.getName()))return;const r=o(s);return r&&!(r.syntaxFlags.has(e.Experimental)||r.syntaxFlags.has(e.HasNoneKeywords)||r.syntaxFlags.has(e.RelativeColorSyntax))?t(r):void 0}),b=p(v);b!==g&&(f.cloneBefore({value:b}),s?.preserve||f.remove())}});basePlugin.postcss=!0;const postcssPlugin=o=>{const e=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},o);return e.enableProgressiveCustomProperties&&e.preserve?{postcssPlugin:"postcss-hwb-function",plugins:[s(),basePlugin(e)]}:basePlugin(e)};postcssPlugin.postcss=!0;export{postcssPlugin as default,postcssPlugin as"module.exports"};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@csstools/postcss-hwb-function",
|
|
3
3
|
"description": "Use hwb() color functions in CSS",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.0",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
7
7
|
"name": "Antonio Laguna",
|
|
@@ -25,20 +25,13 @@
|
|
|
25
25
|
}
|
|
26
26
|
],
|
|
27
27
|
"engines": {
|
|
28
|
-
"node": ">=
|
|
28
|
+
"node": ">=20.19.0"
|
|
29
29
|
},
|
|
30
30
|
"type": "module",
|
|
31
|
-
"main": "dist/index.cjs",
|
|
32
|
-
"module": "dist/index.mjs",
|
|
33
31
|
"exports": {
|
|
34
32
|
".": {
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
"default": "./dist/index.mjs"
|
|
38
|
-
},
|
|
39
|
-
"require": {
|
|
40
|
-
"default": "./dist/index.cjs"
|
|
41
|
-
}
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"default": "./dist/index.mjs"
|
|
42
35
|
}
|
|
43
36
|
},
|
|
44
37
|
"files": [
|
|
@@ -48,11 +41,11 @@
|
|
|
48
41
|
"dist"
|
|
49
42
|
],
|
|
50
43
|
"dependencies": {
|
|
51
|
-
"@csstools/css-color-parser": "^
|
|
52
|
-
"@csstools/css-parser-algorithms": "^
|
|
53
|
-
"@csstools/css-tokenizer": "^
|
|
54
|
-
"@csstools/postcss-progressive-custom-properties": "^
|
|
55
|
-
"@csstools/utilities": "^
|
|
44
|
+
"@csstools/css-color-parser": "^4.0.0",
|
|
45
|
+
"@csstools/css-parser-algorithms": "^4.0.0",
|
|
46
|
+
"@csstools/css-tokenizer": "^4.0.0",
|
|
47
|
+
"@csstools/postcss-progressive-custom-properties": "^5.0.0",
|
|
48
|
+
"@csstools/utilities": "^3.0.0"
|
|
56
49
|
},
|
|
57
50
|
"peerDependencies": {
|
|
58
51
|
"postcss": "^8.4"
|
package/dist/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var s=require("@csstools/postcss-progressive-custom-properties"),e=require("@csstools/css-color-parser"),t=require("@csstools/utilities"),r=require("@csstools/css-parser-algorithms"),o=require("@csstools/css-tokenizer");const a=/\bhwb\(/i,n=/^hwb$/i,basePlugin=s=>({postcssPlugin:"postcss-hwb-function",Declaration(i){const c=i.value;if(!a.test(c))return;if(t.hasFallback(i))return;if(t.hasSupportsAtRuleAncestor(i,a))return;const l=r.replaceComponentValues(r.parseCommaSeparatedListOfComponentValues(o.tokenize({css:c})),s=>{if(!r.isFunctionNode(s)||!n.test(s.getName()))return;const t=e.color(s);return t&&!(t.syntaxFlags.has(e.SyntaxFlag.Experimental)||t.syntaxFlags.has(e.SyntaxFlag.HasNoneKeywords)||t.syntaxFlags.has(e.SyntaxFlag.RelativeColorSyntax))?e.serializeRGB(t):void 0}),u=r.stringify(l);u!==c&&(i.cloneBefore({value:u}),s?.preserve||i.remove())}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},e);return t.enableProgressiveCustomProperties&&t.preserve?{postcssPlugin:"postcss-hwb-function",plugins:[s(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0,module.exports=postcssPlugin;
|