Skip to content

Custom variants don't work with @scopeΒ #18961

@msfragala

Description

@msfragala

What version of Tailwind CSS are you using?

v4.1.13

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

Next.js 15.5.2

What version of Node.js are you using?

v24.7.0

What browser are you using?

Chrome (v140)

What operating system are you using?

macOS

Reproduction URL

https://play.tailwindcss.com/0NPeZeXJ61

Describe your issue

Custom variants don't work with @scope rules. When defining a custom variant using @scope, the generated code places the rule inside the class instead of the class inside the rule. But @scope rules don't seem to support nesting like this as the resulting class has no effect

Metadata

Metadata

Assignees

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