-
Notifications
You must be signed in to change notification settings - Fork 4.6k
[V4] :merge selector broken #15617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This comment has been minimized.
This comment has been minimized.
@dona168lee I may well need to revert to 3.0 for this app to be properly accessible however this is still a bug in 4.0 that should be raised and addressed. |
Update, now that V4 is released it seems they removed support for this feature (or at least it is now gone from the documentation) |
I posted a quick workaround in the related issue in the react-spectrum repo: |
Closes #15617 ## Summary This PR ignores `addVariant(…)` legacy JS plugin calls for variants that are using the [`:merge(…)` selector](https://v3.tailwindcss.com/docs/plugins#parent-and-sibling-states) for parent and sibling states. We can ignore these now because in v4, `group-*` and `peer-*` variants _compound automatically_ and you don't have to define them anymore. ## Test plan Added a unit test to ensure that the `optional` variant example from the v3 docs work as expected.
We're going to ignore rules that contain a |
What version of Tailwind CSS are you using?
v4.0.0-beta.9
What build tool (or framework if it abstracts the build tool) are you using?
Next.js 15.1.4
What version of Node.js are you using?
v22.13.0
What browser are you using?
Chrome
What operating system are you using?
macOS
Reproduction URL
https://github.com/mhornbacher/tailwind-repro
Describe your issue
At a high level:
peer-
class with hot reloadingpeer-
classes are always active after a buildThe cause for this, as far as I can tell is as follows:
In the documentation for plugins there is a special
:merge
selector designed for plugins (like react-aria-components in this example) to extend thefocus
,disabled
... selectors, in this case to enable them to be triggered in more complex accessibility scenarios. (see the react-aria implementation for example.However in Tailwind 4.0 it seems that this selector is not handled by the new lighting CSS compiler. I know its not that common, but many projects rely on this to simplify accessibility development for their team. Which is something I know that the tailwind team cares about as well :)
The text was updated successfully, but these errors were encountered: