From e0173038593452837de70ea7a9964d37601f4c2b Mon Sep 17 00:00:00 2001 From: Martin Grabina Date: Wed, 2 Dec 2026 17:21:42 -0300 Subject: [PATCH] fix(theme): keep MUI's var-composed colors out of the Display-P3 layer The P3 layer converted every rgb() palette value, including Skeleton's bg, which MUI builds as rgba(var(--mui-palette-text-primaryChannel) / 0.13). The conversion gave color(display-p3 NaN NaN NaN), so every skeleton was transparent on wide-gamut screens. --- src/utils/theme.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/theme.tsx b/src/utils/theme.tsx index 63439aa46f..b5d00028b1 100644 --- a/src/utils/theme.tsx +++ b/src/utils/theme.tsx @@ -1476,7 +1476,9 @@ export const createAppTheme = () => { // --- Display-P3 override layer ------------------------------------------------------------- -const isColorValue = (v: string) => v.startsWith('#') || v.startsWith('rgb'); +// MUI composes some tokens from other vars (Skeleton's bg is `rgba(var(...) / 0.13)`), which P3 can't parse. +const isColorValue = (v: string) => + (v.startsWith('#') || v.startsWith('rgb')) && !v.includes('var('); // Walk a color scheme's palette and, for every solid color leaf, emit a P3 override keyed to // the CSS variable MUI generates for it (`--mui-palette-`). Non-color