We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
What version of Tailwind CSS are you using?
v3.4.3
What build tool (or framework if it abstracts the build tool) are you using?
N/A
What version of Node.js are you using?
What browser are you using?
Chrome
What operating system are you using?
macOS
Reproduction URL
https://play.tailwindcss.com/0ypNCIcob4
Describe your issue
Arbitrary variants allow you to only apply a class if it is the child of an element matching a selector.
This can be done like so: [.parentclass_&]:text-blue-600
[.parentclass_&]:text-blue-600
You can also match based on data attributes like so: data-[parentdata='true']:text-blue-600
data-[parentdata='true']:text-blue-600
For some reason combining the two does not seem to work: data-[parentdata='true'_&]:text-blue-600 or data-[parentdata='true']_&:text-blue-600
data-[parentdata='true'_&]:text-blue-600
data-[parentdata='true']_&:text-blue-600
The text was updated successfully, but these errors were encountered:
parentdata='true'_& is not a valid value for the data-[]: variant. It expects only either:
parentdata='true'_&
data-[]:
<ident>
data-<ident>
<ident>=<value>
data-<ident>="<value>"
For your case, it seems you could achieve your goal via a group-data-* variant: https://play.tailwindcss.com/7DmAySMH3P
group-data-*
Sorry, something went wrong.
Thanks! That looks much cleaner too..
No branches or pull requests
What version of Tailwind CSS are you using?
v3.4.3
What build tool (or framework if it abstracts the build tool) are you using?
N/A
What version of Node.js are you using?
N/A
What browser are you using?
Chrome
What operating system are you using?
macOS
Reproduction URL
https://play.tailwindcss.com/0ypNCIcob4
Describe your issue
Arbitrary variants allow you to only apply a class if it is the child of an element matching a selector.
This can be done like so:
[.parentclass_&]:text-blue-600
You can also match based on data attributes like so:
data-[parentdata='true']:text-blue-600
For some reason combining the two does not seem to work:
data-[parentdata='true'_&]:text-blue-600
or
data-[parentdata='true']_&:text-blue-600
The text was updated successfully, but these errors were encountered: