Skip to content

Fix WCAG 2.5.5 touch targets and lower tablet sidebar breakpoint to 768px#22891

Merged
pelikhan merged 2 commits intomainfrom
copilot/fix-small-touch-targets-mobile
Mar 25, 2026
Merged

Fix WCAG 2.5.5 touch targets and lower tablet sidebar breakpoint to 768px#22891
pelikhan merged 2 commits intomainfrom
copilot/fix-small-touch-targets-mobile

Conversation

Copy link
Contributor

Copilot AI commented Mar 25, 2026

Addresses two accessibility warnings from the 2026-03-25 multi-device docs test: undersized touch targets on mobile (WCAG 2.5.5) and the sidebar remaining hidden behind a hamburger at 768–834px tablet viewports.

W1 — Touch targets

  • CustomFooter.astro: Footer links (Community Feedback, llms.txt, agent links, Terms/Privacy) had heights as small as 19px. Added min-height: 44px; display: inline-flex; align-items: center under @media (max-width: 768px).
  • ThemeToggle.astro: Existing fix only targeted .icon-wrapper; added min-height: 44px to the outer .theme-label wrapper so the full tap area meets the minimum.

W2 — Tablet sidebar breakpoint

Starlight's default persistent-sidebar breakpoint is 50rem (800px). iPads at 768px fall below this, forcing the hamburger overlay.

Added @media (min-width: 48rem) in custom.css to:

  • Set --sl-content-inline-start: var(--sl-sidebar-width) on html[data-has-sidebar]
  • Force --sl-sidebar-visibility: visible and correct dimensions on .sidebar-pane
  • Hide starlight-menu-button button (hamburger no longer needed)
  • Restore overflow: auto on [data-mobile-menu-expanded]

Tests

Updated mobile-responsive.spec.ts:

  • Added iPad (768px) and iPad Pro 11 (834px) viewports
  • Added should show persistent sidebar on tablet assertion (sidebar visible at ≥768px)
  • Fixed mobile-only check from <= 768< 768 to match the new breakpoint boundary

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…68px

- W1: Add min-height 44px touch targets for footer links (Community Feedback,
  llms.txt, agent links) in CustomFooter.astro
- W1: Add min-height 44px to theme-label wrapper in ThemeToggle.astro
- W2: Lower sidebar breakpoint from 800px to 768px in custom.css so iPads
  show persistent sidebar instead of hamburger overlay
- Tests: Add iPad 768px and iPad Pro 11 834px form factors, add tablet
  sidebar visibility test, fix mobile threshold from <= to <768px"

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/70fed5a6-f2d1-42f9-9fe5-965590e3c0bc
Copilot AI changed the title [WIP] Fix small touch targets on mobile devices Fix WCAG 2.5.5 touch targets and lower tablet sidebar breakpoint to 768px Mar 25, 2026
Copilot AI requested a review from pelikhan March 25, 2026 12:48
@pelikhan pelikhan marked this pull request as ready for review March 25, 2026 14:04
Copilot AI review requested due to automatic review settings March 25, 2026 14:04
@pelikhan pelikhan merged commit 8f00205 into main Mar 25, 2026
@pelikhan pelikhan deleted the copilot/fix-small-touch-targets-mobile branch March 25, 2026 14:04
Copy link
Contributor

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

Improves docs site accessibility and tablet UX by increasing mobile touch target sizes and making the Starlight sidebar persist at 768px+ (instead of ~800px).

Changes:

  • Increased minimum touch target sizes for footer links and theme toggle on mobile.
  • Lowered the persistent sidebar breakpoint to 768px via custom CSS overrides.
  • Expanded Playwright responsive tests to cover 768px/834px tablet viewports and assert sidebar visibility at the new breakpoint.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
docs/tests/mobile-responsive.spec.ts Adds iPad/iPad Pro viewports and a new assertion that the sidebar is visible at ≥768px; updates the mobile boundary check to < 768.
docs/src/styles/custom.css Introduces a @media (min-width: 48rem) block to force persistent sidebar behavior at 768px+ and hide the hamburger.
docs/src/components/ThemeToggle.astro Ensures the theme toggle’s outer label meets minimum touch target height on mobile.
docs/src/components/CustomFooter.astro Ensures footer links meet minimum touch target height on mobile.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

/* Hide the mobile hamburger toggle since the sidebar is now persistent */
starlight-menu-button button {
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

The new @media (min-width: 48rem) block overlaps with existing “mobile” styles at exactly 768px (@media (max-width: 768px) elsewhere in this file). At 768px specifically, .custom-header-links are hidden (custom.css:1390–1399), .tablet-nav-wrapper is still hidden (it only shows at 769–900px), and this change hides starlight-menu-button button, which can leave no obvious navigation control at 768px (notably on the splash/home template where there may be no sidebar). Consider aligning all breakpoints to the new boundary (e.g., change mobile queries to max-width: 767px and start tablet at 768px), and/or only hiding the menu button when a sidebar is present (e.g., scope to html[data-has-sidebar]).

Suggested change
starlight-menu-button button {
html[data-has-sidebar] starlight-menu-button button {

Copilot uses AI. Check for mistakes.
Comment on lines +1647 to +1653
/* Make the sidebar pane always visible (not overlay) */
.sidebar-pane {
--sl-sidebar-visibility: visible;
width: var(--sl-sidebar-width) !important;
background-color: var(--sl-color-bg-sidebar) !important;
border-inline-end: 1px solid var(--sl-color-hairline-shade) !important;
}
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

This .sidebar-pane styling applies to all widths >=768px and will override the existing “Only make sidebar transparent on desktop” rule (@media (min-width: 769px) { .sidebar-pane { background: transparent !important; } } earlier in this file). If the intent is only to patch the 768–799px gap in Starlight’s default breakpoint, consider scoping these overrides to that range (e.g., min-width: 48rem AND max-width: 49.999rem / 799px) or avoid overriding desktop-only appearance properties (background/border) while still forcing visibility.

Copilot uses AI. Check for mistakes.
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.

🔍 Multi-Device Docs Testing Report - 2026-03-25

3 participants