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]+$/; 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))',