Skip to content

Variables without opacity #207

Description

@FerVillanuevas

Describe the bug
First time trying v5, everything its amazing. just found this issue or maybe miss configuration on my project, but variables cant have opacity.

Image

Reproduction
Please see our contribution guide: https://github.com/FerVillanuevas/nativewind

Activity

  1. marklawlor commented on Oct 2, 2025

    @marklawlor
    Contributor

    TailwindCSS is outputting the following CSS

    .bg-destructive\/10 {
      background-color: var(--destructive);
      @supports (color: color-mix(in lab, red, red)) {
        background-color: color-mix(in oklab, var(--destructive) 10%, transparent);
      }
    }
    

    Because React Native doesn't have a color-mix function, the rules in @supports() are ignored, hence you only receive the non-transparent version.

    I'll have a think about this, but I think the only solution might be asking uses to add a color-mix polyfill (~65KB) to their app.

    This works for non-variable values because the color-mix() value is calculated at build time.

  2. marklawlor commented on Oct 2, 2025

    @marklawlor
    Contributor

    WIP PR #208

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions