Skip to content
New issue

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

Change aria current tw configuration #2703

Closed
BorghildSelle opened this issue Dec 2, 2024 · 0 comments
Closed

Change aria current tw configuration #2703

BorghildSelle opened this issue Dec 2, 2024 · 0 comments
Assignees

Comments

@BorghildSelle
Copy link
Contributor

BorghildSelle commented Dec 2, 2024

remove from config

  variants: {
    extend: {
      borderColor: ['aria-current'],
      backgroundColor: ['aria-current'],
    },
  },

and in theme add

      aria: {
        current: 'current="page"',
      },

based on that aria current is "true" when "page" in submenu
aria-current={router.asPath == link?.link?.slug ? 'page' : 'false'}

Should look if somewhere else aria-current is used as something else too, since it can be one of these.
AriaAttributes["aria-current"]?: boolean | "time" | "step" | "true" | "false" | "page" | "location" | "date" | undefined

If aria current is used more places with tailwind aria-current:, then need to add to the aria config.

@BorghildSelle BorghildSelle self-assigned this Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant