Replies: 1 comment
-
Update: The code above is actually wrong and https://github.com/tailwindlabs/headlessui/blob/main/packages/%40headlessui-tailwindcss/src/index.ts#L15 shows that it is a lot more complex, so closing this for now. Maybe TW v4 will bring us something we can use without a plugin… |
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.
-
The docs at https://headlessui.com/react/disclosure#using-data-attributes explain how to use
ui-open:*
with a special plugin to target the data attributes. It would be great to have a section below that shows how to use the TW native data attribute selection.I used https://tailwindcss.com/blog/tailwindcss-v3-2#data-attribute-variants as a reference and
data-[headlessui-state=open]:
works great, eg. the code below is in a customDisclosure.Button
:I can create a PR for this but AFAIK the docs are in a private repo.
Beta Was this translation helpful? Give feedback.
All reactions