From a66198793f7e515043a0203d1738dca63059076b Mon Sep 17 00:00:00 2001 From: Eduard Trait Date: Fri, 13 Jun 2025 15:36:18 +0700 Subject: [PATCH 1/2] Add support for oklab and oklch func names --- lib/nodes/Func.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nodes/Func.js b/lib/nodes/Func.js index 6c4fd37..663fa6e 100644 --- a/lib/nodes/Func.js +++ b/lib/nodes/Func.js @@ -87,7 +87,7 @@ const cssFunctions = [ const vendorPrefixes = ['-webkit-', '-moz-', '-ms-', '-o-']; const reFunctions = new RegExp(`^(${vendorPrefixes.join('|')})?(${cssFunctions.join('|')})`, 'i'); const rePunctuation = new RegExp(`^(\\${Punctuation.chars.join('|\\')})`); -const reColorFunctions = /^(hsla?|hwb|lab|lch|rgba?)$/i; +const reColorFunctions = /^(hsla?|hwb|(ok)?lab|(ok)?lch|rgba?)$/i; const reVar = /^var$/i; const reVarPrefix = /^--[^\s]+$/; From cdecde43824c33d10f5acd84186849c8651ba823 Mon Sep 17 00:00:00 2001 From: Eduard Trait Date: Fri, 13 Jun 2025 16:45:23 +0700 Subject: [PATCH 2/2] Update tests --- test/fixtures/func.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/fixtures/func.js b/test/fixtures/func.js index 562b243..1a4eefe 100644 --- a/test/fixtures/func.js +++ b/test/fixtures/func.js @@ -26,7 +26,9 @@ module.exports = { 'RGBA( 29, 439 , 29 )', 'RgBa( 29, 439 , 29 )', 'Lab( 40% 56.6 39 )', + 'okLab( 40% 56.6 39 )', 'lCH(40% 68.8 34.5 / 50%)', + 'oklCH(40% 68.8 34.5 / 50%)', 'hwb(90deg 0% 0% / 0.5)', 'calc(-0.5 * var(foo))', 'calc(var(--foo)*var(--bar))',