Skip to content

fix(website): give docs sidebar navigation a proper landmark box - #11414

Open
timotheeguerin wants to merge 2 commits into
microsoft:mainfrom
timotheeguerin:a11y-10793
Open

fix(website): give docs sidebar navigation a proper landmark box#11414
timotheeguerin wants to merge 2 commits into
microsoft:mainfrom
timotheeguerin:a11y-10793

Conversation

@timotheeguerin

@timotheeguerin timotheeguerin commented Jul 27, 2026

Copy link
Copy Markdown
Member

Fixes #10793

Problem

On the Docs pages, screen-reader / landmark tools report the left docs navigation as not belonging to any landmark region (WCAG 1.3.1). This was not resolved by the previous accessibility pass (#11292), which added the aria-label="Documentation" label but not the structural fix.

Root cause: Starlight wraps the docs sidebar in <nav class="sidebar" aria-label="Documentation">, but its inner .sidebar-pane is position: fixed. On desktop that leaves the <nav> landmark element itself with an empty, collapsed layout box, so Accessibility Insights draws the "Documentation navigation" landmark up near the header and the visible left sidebar appears outside any landmark.

reported issue

Fix

In our existing PageFrame.astro Starlight override, move the fixed positioning onto the <nav> landmark itself (desktop only, min-width: 50rem) and let .sidebar-pane fill it. The navigation landmark's bounding box now coincides with the visible sidebar.

Verification

Measured with Playwright at 1365×755 (the reporter's environment):

  • nav.sidebar bounding box is now x:0, y:58, w:300, h:697 — covering the full visible sidebar, with all sidebar links contained inside it.
  • Sidebar stays fixed while the main content scrolls, and scrolls independently when its content overflows.
  • Main content offset unchanged (x:300); no visual regression.
  • Mobile menu toggle behavior unchanged (the change is scoped to desktop widths).

@typespec/website is a private package, so no changelog entry is required (consistent with #11292).

The docs sidebar is wrapped in Starlight's `<nav class="sidebar"
aria-label="Documentation">`, but its inner `.sidebar-pane` is
`position: fixed`, leaving the `<nav>` landmark element with a collapsed,
empty layout box on desktop. Landmark tools then report the visible left
navigation as not belonging to any landmark region.

Move the fixed positioning onto the `<nav>` landmark itself so its
bounding box coincides with the visible sidebar.

Fixes microsoft#10793
@microsoft-github-policy-service microsoft-github-policy-service Bot added the meta:website TypeSpec.io updates label Jul 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

No changes needing a change description found.

@azure-sdk-automation

azure-sdk-automation Bot commented Jul 27, 2026

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@timotheeguerin
timotheeguerin marked this pull request as ready for review July 27, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta:website TypeSpec.io updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Left navigation controls on Docs page do not have landmark role : A11y_Typespec_Keyboard.

2 participants