Skip to content

Variant inside custom variant makes the app crash #19618

@whazami

Description

@whazami

What version of Tailwind CSS are you using?

v4.1.18

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

SvelteKit 2.50.1, Vite 7.3.1

What version of Node.js are you using?

Bun v1.3.7

What browser are you using?

I tried on Chrome and Firefox

What operating system are you using?

I tried on Windows and iOS

Reproduction URL

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

Describe your issue

I tried to nest a @variant directive inside a @custom-variant (I saw the #18885 PR should have made it possible) like this:

@custom-variant a {
  @slot;
}

@custom-variant b {
  @variant a {
    @slot;
  }
}

but when I use the b: variant in HTML, it makes my app crash (no error message, I have to kill -9 its pid to stop it completely).

You can see in the Tailwind Play URL that it keeps loading infinitely.

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