Skip to content

Custom theme variables not working in media queries for custom variants #17840

@NoelDeMartin

Description

@NoelDeMartin

What version of Tailwind CSS are you using?

v4.1.5

What build tool (or framework if it abstracts the build tool) are you using?

Tailwind Play

What version of Node.js are you using?

Tailwind Play

What browser are you using?

Firefox, Chrome

What operating system are you using?

Ubuntu

Reproduction URL

https://play.tailwindcss.com/IeRkVmIgty?file=css

Describe your issue

In the linked reproduction, when the viewport is smaller than the md breakpoint, both the square and the circle should change colors. But only the square is working.

I am defining two custom variants using exactly the same syntax, but it doesn't work with my custom variable (--breakpoint-custom), though it does with a built-in variable (--breakpoint-md).

I have defined my custom variable under @theme, so I think it should work.

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