Skip to content

🎨 Palette: [UX improvement] Add ARIA attributes and focus rings to Navbar toggle buttons#118

Open
belpythons wants to merge 1 commit into
masterfrom
palette/navbar-a11y-focus-rings-18004634736279953681
Open

🎨 Palette: [UX improvement] Add ARIA attributes and focus rings to Navbar toggle buttons#118
belpythons wants to merge 1 commit into
masterfrom
palette/navbar-a11y-focus-rings-18004634736279953681

Conversation

@belpythons

Copy link
Copy Markdown
Owner

💡 What

Added missing ARIA attributes (aria-expanded and aria-label) and explicit keyboard focus rings (focus-visible:ring-2 focus-visible:ring-accent-500) to the interactive toggle buttons in the Navbar component (Forum dropdown, Theme toggles, and mobile menu toggle). Cleaned up a minor unused variable warning.

🎯 Why

Icon-only buttons and interactive disclosure widgets (like dropdowns and mobile menus) frequently fail to communicate their state to screen readers and often lack clear visual indicators when navigated via keyboard. Adding explicit ARIA attributes and focus rings ensures a significantly better experience for users relying on assistive technologies or keyboard navigation.

📸 Before/After

  • Before: Tabbing through the navbar left users with no clear visual indication of which element was focused, especially on the icon-only toggle buttons. Screen readers were not informed if the mobile menu or forum dropdown was currently expanded.
  • After: Keyboard users now see a clear, high-contrast focus ring around the active button. Screen readers now correctly announce the expanded/collapsed state of the dropdown and mobile menu.

♿ Accessibility

  • Added aria-expanded to the Forum dropdown and mobile menu toggle buttons.
  • Added an explicit aria-label to the mobile menu button that updates based on its state ("Open menu" / "Close menu").
  • Added focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-500 to all toggle buttons in the navbar.

PR created automatically by Jules for task 18004634736279953681 started by @belpythons

Added explicit `aria-expanded` and `aria-label` attributes to the Forum dropdown and mobile menu toggle buttons. Implemented explicit `focus-visible` utility classes for keyboard focus rings on all interactive toggle elements (dropdown, themes, mobile menu) to improve accessibility. Removed unused `theme` variable to satisfy linter.

Co-authored-by: belpythons <187399139+belpythons@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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

Successfully merging this pull request may close these issues.

1 participant