fix(navigation): make vertical navigation more accessible#2181
Merged
Conversation
✅ Deploy Preview for stacks ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for stacks-svelte ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🦋 Changeset detectedLatest commit: 8b427e4 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
dancormier
approved these changes
Feb 13, 2026
Contributor
dancormier
left a comment
There was a problem hiding this comment.
Really nice work here @mukunku! Thanks for this fix. I like the API you landed on with NavigationGroup. Makes a lot of sense to me.
![]()
| <nav class="d-grid grid__2 fs-body2 g16 px64 py32 w100 wmx12 lg:px32 md:py24 sm:grid__1 sm:g8 sm:p24" aria-label="Global"> | ||
| {% for card in home.cards %} | ||
| <a class="s-card ai-center d-flex g32 p16" href="{{ card.url }}"> | ||
| <a class="s-card s-link ai-center d-flex g32 p16" href="{{ card.url }}"> |
Contributor
There was a problem hiding this comment.
Thank you! I've been bothered by the ugly browser-default blue/purple each time I hit the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR suggests some small but breaking changes to the markup so we can have an accessible vertical navigation component.
Before:
After:
Motivation
This PR was created because the current beta Navigation Svelte component, when in vertical mode, has some accessibility issues around its usage of
role="separator":<li>items themselves which causes screen readers to incorrectly count how many navigation items are present.presentationrole which isn't something we necessarily want in our navigation component.Rationale
This question does a good breakdown of why I went with breaking the different navigation groups into actual separate
<ul>elements. This does mean I had to make some assumptions around nested<ul>elements in the.lesscode but I'm hoping this is an acceptable trade-off to have an accessible component.Additionally, I used an
<h4>(configurable in svelte) element as the group title as that is the recommended approach for screen readers.How to Test
Stacks Docs
The
Titlesvariant is what has changed.<ul>elements for the different navigation groups and each list contains the various navigation items now.Stacks Svelte
NavigationTitlehas been renamed toNavigationGroupand now encapsulates its childNavigationItems.