@csstools/postcss-oklab-function 4.0.12 → 5.0.1

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,9 +1,9 @@
1
1
  # Changes to PostCSS OKLab Function
2
2
 
3
- ### 4.0.12
3
+ ### 5.0.1
4
4
 
5
- _September 21, 2025_
5
+ _January 25, 2026_
6
6
 
7
- - Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`4.2.1`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#421) (patch)
7
+ - Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`4.0.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#401) (patch)
8
8
 
9
9
  [Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-oklab-function/CHANGELOG.md)
package/dist/index.d.ts CHANGED
@@ -16,5 +16,6 @@ export declare type pluginOptions = {
16
16
  /** Transform oklab() and oklch() functions in CSS. */
17
17
  declare const postcssPlugin: PluginCreator<pluginOptions>;
18
18
  export default postcssPlugin;
19
+ export { postcssPlugin as 'module.exports' }
19
20
 
20
21
  export { }
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import s from"@csstools/postcss-progressive-custom-properties";import{color as e,SyntaxFlag as t,serializeRGB as o,colorDataFitsRGB_Gamut as r,serializeP3 as a}from"@csstools/css-color-parser";import{hasFallback as l,hasSupportsAtRuleAncestor as i}from"@csstools/utilities";import{replaceComponentValues as n,parseCommaSeparatedListOfComponentValues as c,isFunctionNode as u,stringify as p}from"@csstools/css-parser-algorithms";import{tokenize as m}from"@csstools/css-tokenizer";const g=/\b(?:oklab|oklch)\(/i,f=/^(?:oklab|oklch)$/i,basePlugin=s=>({postcssPlugin:"postcss-oklab-function",Declaration(b){const y=b.value;if(!g.test(y))return;if(l(b))return;if(i(b,g))return;const v=m({css:y}),F=n(c(v),s=>{if(!u(s)||!f.test(s.getName()))return;const r=e(s);return r&&!(r.syntaxFlags.has(t.Experimental)||r.syntaxFlags.has(t.HasNoneKeywords)||r.syntaxFlags.has(t.RelativeColorSyntax))?o(r):void 0}),x=p(F);if(x===y)return;let P=x;s?.subFeatures.displayP3&&(P=p(n(c(v),s=>{if(!u(s)||!f.test(s.getName()))return;const l=e(s);return l&&!(l.syntaxFlags.has(t.Experimental)||l.syntaxFlags.has(t.HasNoneKeywords)||l.syntaxFlags.has(t.RelativeColorSyntax))?r(l)?o(l):a(l):void 0}))),b.cloneBefore({value:x}),s?.subFeatures.displayP3&&P!==x&&b.cloneBefore({value:P}),s?.preserve||b.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return t.subFeatures=Object.assign({displayP3:!0},t.subFeatures),t.enableProgressiveCustomProperties&&(t.preserve||t.subFeatures.displayP3)?{postcssPlugin:"postcss-oklab-function",plugins:[s(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0;export{postcssPlugin as default};
1
+ import s from"@csstools/postcss-progressive-custom-properties";import{color as e,SyntaxFlag as t,serializeRGB as o,colorDataFitsRGB_Gamut as r,serializeP3 as a}from"@csstools/css-color-parser";import{hasFallback as l,hasSupportsAtRuleAncestor as i}from"@csstools/utilities";import{replaceComponentValues as n,parseCommaSeparatedListOfComponentValues as u,isFunctionNode as c,stringify as p}from"@csstools/css-parser-algorithms";import{tokenize as m}from"@csstools/css-tokenizer";const g=/\b(?:oklab|oklch)\(/i,f=/^(?:oklab|oklch)$/i,basePlugin=s=>({postcssPlugin:"postcss-oklab-function",Declaration(b){const y=b.value;if(!g.test(y))return;if(l(b))return;if(i(b,g))return;const v=m({css:y}),x=n(u(v),s=>{if(!c(s)||!f.test(s.getName()))return;const r=e(s);return r&&!(r.syntaxFlags.has(t.Experimental)||r.syntaxFlags.has(t.HasNoneKeywords)||r.syntaxFlags.has(t.RelativeColorSyntax))?o(r):void 0}),F=p(x);if(F===y)return;let d=F;s?.subFeatures.displayP3&&(d=p(n(u(v),s=>{if(!c(s)||!f.test(s.getName()))return;const l=e(s);return l&&!(l.syntaxFlags.has(t.Experimental)||l.syntaxFlags.has(t.HasNoneKeywords)||l.syntaxFlags.has(t.RelativeColorSyntax))?r(l)?o(l):a(l):void 0}))),b.cloneBefore({value:F}),s?.subFeatures.displayP3&&d!==F&&b.cloneBefore({value:d}),s?.preserve||b.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return t.subFeatures=Object.assign({displayP3:!0},t.subFeatures),t.enableProgressiveCustomProperties&&(t.preserve||t.subFeatures.displayP3)?{postcssPlugin:"postcss-oklab-function",plugins:[s(),basePlugin(t)]}:basePlugin(t)};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-oklab-function",
3
3
  "description": "Use oklab() and oklch() color functions in CSS",
4
- "version": "4.0.12",
4
+ "version": "5.0.1",
5
5
  "author": "Jonathan Neal <jonathantneal@hotmail.com>",
6
6
  "license": "MIT-0",
7
7
  "funding": [
@@ -15,20 +15,13 @@
15
15
  }
16
16
  ],
17
17
  "engines": {
18
- "node": ">=18"
18
+ "node": ">=20.19.0"
19
19
  },
20
20
  "type": "module",
21
- "main": "dist/index.cjs",
22
- "module": "dist/index.mjs",
23
21
  "exports": {
24
22
  ".": {
25
- "import": {
26
- "types": "./dist/index.d.ts",
27
- "default": "./dist/index.mjs"
28
- },
29
- "require": {
30
- "default": "./dist/index.cjs"
31
- }
23
+ "types": "./dist/index.d.ts",
24
+ "default": "./dist/index.mjs"
32
25
  }
33
26
  },
34
27
  "files": [
@@ -38,11 +31,11 @@
38
31
  "dist"
39
32
  ],
40
33
  "dependencies": {
41
- "@csstools/css-color-parser": "^3.1.0",
42
- "@csstools/css-parser-algorithms": "^3.0.5",
43
- "@csstools/css-tokenizer": "^3.0.4",
44
- "@csstools/postcss-progressive-custom-properties": "^4.2.1",
45
- "@csstools/utilities": "^2.0.0"
34
+ "@csstools/css-color-parser": "^4.0.1",
35
+ "@csstools/css-parser-algorithms": "^4.0.0",
36
+ "@csstools/css-tokenizer": "^4.0.0",
37
+ "@csstools/postcss-progressive-custom-properties": "^5.0.0",
38
+ "@csstools/utilities": "^3.0.0"
46
39
  },
47
40
  "peerDependencies": {
48
41
  "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"),a=require("@csstools/css-parser-algorithms"),r=require("@csstools/css-tokenizer");const o=/\b(?:oklab|oklch)\(/i,l=/^(?:oklab|oklch)$/i,basePlugin=s=>({postcssPlugin:"postcss-oklab-function",Declaration(n){const i=n.value;if(!o.test(i))return;if(t.hasFallback(n))return;if(t.hasSupportsAtRuleAncestor(n,o))return;const u=r.tokenize({css:i}),c=a.replaceComponentValues(a.parseCommaSeparatedListOfComponentValues(u),s=>{if(!a.isFunctionNode(s)||!l.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}),p=a.stringify(c);if(p===i)return;let g=p;s?.subFeatures.displayP3&&(g=a.stringify(a.replaceComponentValues(a.parseCommaSeparatedListOfComponentValues(u),s=>{if(!a.isFunctionNode(s)||!l.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.colorDataFitsRGB_Gamut(t)?e.serializeRGB(t):e.serializeP3(t):void 0}))),n.cloneBefore({value:p}),s?.subFeatures.displayP3&&g!==p&&n.cloneBefore({value:g}),s?.preserve||n.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return t.subFeatures=Object.assign({displayP3:!0},t.subFeatures),t.enableProgressiveCustomProperties&&(t.preserve||t.subFeatures.displayP3)?{postcssPlugin:"postcss-oklab-function",plugins:[s(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0,module.exports=postcssPlugin;