Skip to content

dark variant not respecting bg-opacity #2966

@Yiddishe-Kop

Description

@Yiddishe-Kop

Describe the problem:

I have darkMode: 'class' in my config.

When using these classes: bg-gray-100 bg-opacity-50 dark:bg-gray-900 , the bg-opacity is only applied in light mode, but in dark mode bg-opacity is ignored.

I had to add the dark variant to: backgroundOpacity: ['dark'], then also add dark:bg-opacity-50 to the element to get it to work in dark mode.

Expected behaviour: dark mode should also respect the bg-opacity class (unless overriden for dark).

Link to a minimal reproduction:

https://play.tailwindcss.com/GHoILXz6cp

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