Sibling selector (~) stopped working in Tailwind CSS v4 #18862
Unanswered
MonaAghili
asked this question in
Help
Replies: 1 comment
-
It's not the sibling combinator that is the problem. Rather, it is that stacked variants in v4 is applied in the opposite order to v3. So instead of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In Tailwind CSS v3, I used the following selector to style a
.rating-button
if it had a hovered sibling after it:Here
~
is used to check for following siblings.This worked perfectly in v3, but after upgrading to Tailwind CSS v4, it no longer works.
Playground link: https://play.tailwindcss.com/ed3PRPUUgQ
You can switch the version in the Playground link to see the issue in action.
Is there a new way to write sibling selectors in v4? Or did support for
~
change?Beta Was this translation helpful? Give feedback.
All reactions