Skip to content

[Pro] color-mix() in CSS variables resolves to "invalid" on native — breaks Reanimated color animations #553

@stackra-usr

Description

@stackra-usr

Bug summary

uniwind-pro@1.2.0 fails to resolve CSS color-mix() functions used in HeroUI Native's theme variables, causing Reanimated to crash with "Invalid color value: invalid".

Environment

uniwind-pro: 1.2.0 (npm:uniwind-pro@1.2.0 aliased as "uniwind")
heroui-native: 1.0.4
react-native: 0.85.3
react-native-reanimated: 4.4.0
Expo SDK: 56
Platform: iOS Simulator (iPhone 17 Pro Max, iOS 26.5)

Steps to reproduce

  1. Install uniwind-pro@1.2.0 as "uniwind": "npm:uniwind-pro@1.2.0"
  2. Import heroui-native/styles in global.css
  3. Wrap app with <HeroUINativeProvider>
  4. Render any HeroUI Native component (Button, Switch, etc.)

Expected behavior

CSS variables like --color-accent-hover defined with color-mix() in heroui-native/styles/theme.css should resolve to valid color values.

Actual behavior

WARN  Uniwind - We couldn't find your variable --color-accent-hover
WARN  Uniwind - className 'accent-accent' was provided to extract accentColor but no color was found
WARN  "invalid" is not a valid color or brush
ERROR [Error: [Reanimated] Invalid color value: "invalidNaN"]

Root cause

HeroUI Native's theme.css defines:

--color-accent-hover: color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%);

color-mix() is a web-only CSS function. Uniwind Pro 1.2.0 cannot compute it on the native runtime, so the variable resolves to "invalid" which Reanimated then fails to parse as a color.

Workaround

Using community uniwind@1.7.0 (free version) instead of uniwind-pro@1.2.0 resolves the issue. The HeroUI Native example app also uses community uniwind@1.3.2.

Expected fix

Uniwind Pro should either:

  1. Implement color-mix() resolution on native (compute the blended color at build/runtime)
  2. Provide a fallback mechanism when color-mix() is encountered (return a safe default color instead of "invalid")
  3. Pre-compute color-mix() values during the CSS parsing phase

Notes

  • The HeroUI Native source repo (heroui-native-main) references uniwind: 1.3.2 (community) in its example, not Pro
  • This suggests Pro wasn't tested with HeroUI Native's color-mix() theme variables
  • The issue only affects animated components (Reanimated) — static className usage may work fine since the color is never passed to withTiming/withSpring

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions