adobe / react-spectrum

A collection of libraries and tools that help you build adaptive, accessible, and robust user experiences.
https://react-spectrum.adobe.com
Apache License 2.0
12.21k stars 1.07k forks source link

Bug with tailwindcss-react-aria-components and group class #5642

Open federicocappellotto97 opened 6 months ago

federicocappellotto97 commented 6 months ago

Provide a general summary of the issue here

Doing this

<div class="group">
  <div class="h-4 w-4 group-[:not([aria-valuenow])]:bg-red-400"></div>
</div>

I get this class

.group:where([data-rac])[data-disabled] .group-\[\:not\(\[aria-valuenow\]\)\]\:w-1\/4 {
    background: red
}

And this is not working since it's adding [data-disabled] For example if i do it in tailwind i don't get that https://play.tailwindcss.com/CxjNxTGfBp

๐Ÿค” Expected Behavior?

https://play.tailwindcss.com/CxjNxTGfBp

๐Ÿ˜ฏ Current Behavior

.group:where([data-rac])[data-disabled]

๐Ÿ’ Possible Solution

Removing [data-disabled]

๐Ÿ”ฆ Context

No response

๐Ÿ–ฅ๏ธ Steps to Reproduce

Version

     "tailwindcss-react-aria-components": "^1.0.0",         "react-aria": "^3.31.0",         "react-aria-components": "^1.0.0",

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

Mac OS

๐Ÿงข Your Company/Team

No response

๐Ÿ•ท Tracking Issue

No response

reidbarber commented 6 months ago

I've put your example in a codesandbox, and I'm not seeing the issue you mentioned: https://codesandbox.io/p/devbox/elastic-neco-xyjdy4

Outputted CSS: https://xyjdy4-1234.csb.app/index.2cdaf7bc.css

federicocappellotto97 commented 6 months ago

I've put your example in a codesandbox, and I'm not seeing the issue you mentioned: https://codesandbox.io/p/devbox/elastic-neco-xyjdy4

Outputted CSS: https://xyjdy4-1234.csb.app/index.2cdaf7bc.css

Here a simple repo where you can find the issue Maybe it is related to NextJS?

reidbarber commented 6 months ago

@federicocappellotto97 I think you may have forgotten to include a link.

federicocappellotto97 commented 6 months ago

@federicocappellotto97 I think you may have forgotten to include a link.

Ops sorry ahah here it is: https://github.com/federicocappellotto97/adobe-react-spectrum-issues-5642

reidbarber commented 6 months ago

@federicocappellotto97 It doesn't look like that repo has react-aria-components or tailwindcss-react-aria-components installed.

Also, since you have that in a github repo, you can access a sandbox at this link: https://codesandbox.io/p/devbox/github/federicocappellotto97/adobe-react-spectrum-issues-5642/tree/main/

federicocappellotto97 commented 6 months ago

@federicocappellotto97 It doesn't look like that repo has react-aria-components or tailwindcss-react-aria-components installed.

Also, since you have that in a github repo, you can access a sandbox at this link: https://codesandbox.io/p/devbox/github/federicocappellotto97/adobe-react-spectrum-issues-5642/tree/main/

sorry again.. didn't push last changes, check now

reidbarber commented 6 months ago

Interesting... not sure why it would behave differently with that setup.