Skip to content

Sidebar a11y fixes #59

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

Merged
merged 3 commits into from
Jul 1, 2025
Merged

Sidebar a11y fixes #59

merged 3 commits into from
Jul 1, 2025

Conversation

danielguillan
Copy link
Contributor

Resolves https://github.com/github/primer/issues/5381

This pull request moves the sidebar before the content in the DOM and introduces an aside region to enhance accessibility. The aria-label now dynamically displays the appropriate title based on the active header link or site title.

@Copilot Copilot AI review requested due to automatic review settings July 1, 2025 08:33
@danielguillan danielguillan requested a review from a team as a code owner July 1, 2025 08:33
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves sidebar accessibility by moving the sidebar before the main content and wrapping it in an aside element with a dynamic aria-label.

  • Sidebar is now rendered within an aside element with a dynamic label based on the active header link or site title.
  • The previous static sidebar pane has been removed to maintain a logical DOM order.

hidden={{narrow: true}}
divider="line"
>
<aside aria-label={`${activeHeaderLink ? activeHeaderLink.title : siteTitle} sidebar`}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PageLayout.Pane is not polymorphic, so we need to nest the aside region here.

Copy link
Collaborator

@rezrah rezrah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great 👍

@danielguillan danielguillan merged commit c24a5b9 into main Jul 1, 2025
8 checks passed
@danielguillan danielguillan deleted the danielguillan/nav-a11y-fixes branch July 1, 2025 09:34
@primer-css primer-css mentioned this pull request Jul 1, 2025
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.

2 participants