Skip to content
Discussion options

You must be logged in to vote

Your navigation structure is fine. Two separate things are stopping the styles from landing, and the first one is why it looks like the component "loses track" of the parent.

1. data-[active=true] never matches

The attribute the component renders is valueless. From nuxt/ui's own render snapshot (test/components/__snapshots__/NavigationMenu.spec.ts.snap, the collapsed vertical case, on an item declared with active: true):

<button type="button" data-reka-collection-item="" data-active="" aria-current="page" data-slot="link" ...>

It is data-active="", not data-active="true". Tailwind compiles data-[active=true]: to [data-active="true"], which cannot match an empty value. So every one of thes…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@karagoezt
Comment options

Answer selected by karagoezt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants