Skip to content

Opacity showing the light variant in dark mode #520

Description

@robert-barahona

Hey! We're migrating from NativeWind.

Our app supports light/dark mode and we have custom colors defined in colors.css for example:

@theme {
  /* Raw palette */
  --color-white: #ffffff;
  --color-black: #000000;

  --color-bg-primary: var(--color-white);
}

@layer theme {
  :root {
    @variant light {
      --color-bg-primary: var(--color-white);
    }

    @variant dark {
      --color-bg-primary: var(--color-black);
    }
  }
}

But when we use the opacity, we only see the light color even if we are in dark mode:

<View className="bg-bg-primary/70" >
    ...
</View>
Image Image

Note: this is only happening with custom css variables, it works with bg-white/70

Uniwind version: 1.6.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    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