You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
color-mix(in oklch, …) resolves to no value on native (OKLCH not registered) #577
On native, a runtime color-mix(in oklch, …) resolves to no value. src/native/styles/functions/color-mix.ts registers only sRGB, P3 and OKLab with colorjs.io, so ColorSpace.get("oklch") throws, the catch returns undefined, and the property is dropped without an error.
This affects any color-mix() that contains var() and uses in oklch, because those are resolved at runtime rather than by lightningcss. For example, a dark-mode token such as:
-import { ColorSpace, to as convert, mix, OKLab, P3, parse, sRGB } from "colorjs.io/fn";+import { ColorSpace, to as convert, mix, OKLab, OKLCH, P3, parse, sRGB } from "colorjs.io/fn";
ColorSpace.register(sRGB);
ColorSpace.register(P3);
ColorSpace.register(OKLab);
+ColorSpace.register(OKLCH);
With this change, ["oklch", "#f0ead6", "62%", "#131108"] resolves to about rgba(147, 143, 127, 1), which matches the browser. We are applying this fix locally with patch-package. It might be worth registering the other spaces that color-mix() accepts as well (lab, lch, hsl, hwb, xyz, …), since any unregistered space fails the same way.
I missed it when filing this: #457 already fixes this. It registers OKLCH (along with HSL, Lab and LCH) and also handles the omitted-weight case from #481.
In our app (Expo SDK 58, nativewind 5.0.0-rc.0, react-native-css 3.1.0-rc.0, iOS simulator), registering OKLCH and filtering the null weight slot made every runtime color-mix(in oklch, …) resolve to the browser's values. #457 makes the same change.
@tzptzptzptzptzp#457 looks okay, but need to double-check the args and parseWeights change.
Although current aim is the remaining Nativewind v4 regressions (only 1 remains AFAICT), this is high value and low risk; I'll aim to get it in the next RC, expected in the next few days.
Activity
tzptzptzptzptzp commentedon Nov 19, 2026
I missed it when filing this: #457 already fixes this. It registers OKLCH (along with HSL, Lab and LCH) and also handles the omitted-weight case from #481.
In our app (Expo SDK 58, nativewind 5.0.0-rc.0, react-native-css 3.1.0-rc.0, iOS simulator), registering OKLCH and filtering the
nullweight slot made every runtimecolor-mix(in oklch, …)resolve to the browser's values. #457 makes the same change.sammoore commentedon Nov 21, 2026
@tzptzptzptzptzp #457 looks okay, but need to double-check the
argsandparseWeightschange.Although current aim is the remaining Nativewind v4 regressions (only 1 remains AFAICT), this is high value and low risk; I'll aim to get it in the next RC, expected in the next few days.