Skip to content

The not- variant does not work as expected with named groups (group/{name}) #15772

@rentalhost

Description

@rentalhost

What version of Tailwind CSS are you using?

v4.0.0

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

Tailwind Play (https://play.tailwindcss.com/)

What version of Node.js are you using?

What browser are you using?

Chrome 131

What operating system are you using?

Windows 11

Reproduction URL

https://play.tailwindcss.com/DKPgTfOLF0

Describe your issue

<!-- Named group (does NOT work) -->  
<div class="group/test bg-red-50 p-8">  
  <div class="not-group/test-hover:text-red-500">Text (should be red when group is NOT hovered)</div>  
</div>  

<!-- Unnamed group (works correctly) -->  
<div class="group bg-green-50 p-8">  
  <div class="not-group-hover:text-green-500">Text (green when group is NOT hovered)</div>  
</div>  

Current Behavior:

  • The not-group/test-hover:text-red-500 class does not apply styles when the named group (group/test) is not hovered.
  • The not-group-hover:text-green-500 class works as intended for the unnamed group.

Expected Behavior:

Both named and unnamed groups should support the not- variant (e.g., not-group/{name}-hover and not-group-hover) to apply styles when the parent group is not in the specified state.

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