Skip to content

Opacity modifiers on theme colours compile to color-mix(unset) on web and native #705

Closed

Description

@simonvanlierde

Opacity modifiers on theme colours compile to color-mix(… unset …) on web and native

Versions: uniwind 1.12.0 and 1.12.1, tailwindcss 4.3.3, Expo SDK web and Android export.

Reproduction

global.css:

@import "tailwindcss";
@import "uniwind";

@layer theme {
  :root {
    @variant light {
      --primary: #1f4c96;
    }
    @variant dark {
      --primary: #8fb8ff;
    }
  }
}

@theme inline {
  --color-primary: var(--primary);
}

Any component using className="bg-primary/12".

Expected: the colour mixes the current theme's --primary, as bg-primary does
(background-color: var(--primary)).

Actual:

  • Web (expo export -p web): .bg-primary\/12{background-color:color-mix(in srgb, unset 12%, transparent)}.
    Browsers drop the declaration, so the class has no effect.
  • Native (expo export -p android --no-bytecode): backgroundColor is
    colorMix("unset", "12%", "#00000000").

The same happens with an arbitrary value, bg-[color-mix(in_srgb,var(--primary)_12%,transparent)].

Likely cause: the themes artifact declares every theme variable as unset in an @theme
block (src/bundler/artifacts/css/themes.ts, `${variable}: unset;`). Tailwind then
resolves var(--primary) against that value when it builds the colour-mix fallback for opacity
modifiers, and Uniwind uses that fallback.

Workaround on web: declaring the mapping with plain @theme instead of @theme inline makes
Tailwind also emit @supports (color: color-mix(in lab, red, red)) { … var(--color-primary) … },
which browsers apply. Native still receives colorMix("unset", …).

Activity

  1. github-actions commented on Oct 2, 2026

    @github-actions
    Contributor

    This issue must be reported using the official issue templates: Bug report or Bug report (Uniwind Pro).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions