Skip to content

TW4 Data Attribute Issue: Losing Global data-theme Inheritance in Next.js #17115

Answered by wongjn
DavidN-Work asked this question in Help
Discussion options

You must be logged in to vote

I would have expected the behavior for it to be the same in v3 and v4 where I would expect it not to work, since the data-theme would need to be on the same element as data-[theme="BrandA"]::

<p data-theme="BrandA" className="data-[theme=BrandA]:flex hidden">Show</p>

Regardless, you should be able to use the in-* variant modifier with data-* to get this to work:

<html data-theme="BrandA"><p class="in-data-[theme=BrandA]:flex hidden">Show</p>

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@DavidN-Work
Comment options

Answer selected by DavidN-Work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants