From 96149775809eed85b453c0b6921a03dd078ace63 Mon Sep 17 00:00:00 2001 From: Arunendra21 <156455722+Arunendra21@users.noreply.github.com> Date: Thu, 6 Aug 2026 09:05:32 +0530 Subject: [PATCH] fix(utils): keep 0 alpha in oklchToCSS output oklchToCSS appended the alpha channel only when `alpha` was truthy, so an alpha of 0 (fully transparent) was dropped and the colour rendered opaque. This affects the alpha theme tokens generated in theme-application.ts, where alpha is passed as `value * 100`. Guard with `alpha != null` so 0 is emitted as `/ 0.00%` while an omitted alpha still produces no alpha channel. Co-authored-by: eeshsaxena --- packages/utils/src/theme/color-conversion.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/utils/src/theme/color-conversion.ts b/packages/utils/src/theme/color-conversion.ts index aefaccf0d65..daa04669579 100644 --- a/packages/utils/src/theme/color-conversion.ts +++ b/packages/utils/src/theme/color-conversion.ts @@ -58,7 +58,7 @@ export function hexToOKLCH(hex: string): OKLCH { */ export function oklchToCSS(oklch: OKLCH, alpha?: number): string { const { l, c, h } = oklch; - return `oklch(${l.toFixed(4)} ${c.toFixed(4)} ${h.toFixed(2)}${alpha ? ` / ${alpha.toFixed(2)}%` : ""})`; + return `oklch(${l.toFixed(4)} ${c.toFixed(4)} ${h.toFixed(2)}${alpha != null ? ` / ${alpha.toFixed(2)}%` : ""})`; } /**