Skip to content

Fix FeatureGrid 3/4-col overflow on narrow viewports + WCAG 2.4.1 skip link#22463

Merged
pelikhan merged 2 commits intomainfrom
copilot/fix-feature-grid-overflow-ipad-pro-11
Mar 23, 2026
Merged

Fix FeatureGrid 3/4-col overflow on narrow viewports + WCAG 2.4.1 skip link#22463
pelikhan merged 2 commits intomainfrom
copilot/fix-feature-grid-overflow-ipad-pro-11

Conversation

Copy link
Contributor

Copilot AI commented Mar 23, 2026

At ~800–1000px viewport width, .feature-grid.columns-3 activated at 50rem but the Starlight content area is only ~760px — causing the third column to overflow and be clipped. columns-4 had the same problem at an even wider threshold. Additionally, the skip navigation link lacked proper WCAG 2.4.1 implementation.

FeatureGrid breakpoint fix (FeatureGrid.astro)

Split the single shared @media (min-width: 50rem) block into per-column breakpoints sized to the actual minimum content width required:

/* Before: all three share 50rem — columns-3/4 overflow narrow viewports */
@media (min-width: 50rem) {
  .feature-grid.columns-2 { grid-template-columns: repeat(2, minmax(20rem, 1fr)); }
  .feature-grid.columns-3 { grid-template-columns: repeat(3, minmax(20rem, 1fr)); }
  .feature-grid.columns-4 { grid-template-columns: repeat(4, minmax(20rem, 1fr)); }
}

/* After: each breakpoint matches the minimum width the layout actually needs */
@media (min-width: 50rem) { /* 2×320 + 20 = 660px */
  .feature-grid.columns-2 { grid-template-columns: repeat(2, minmax(20rem, 1fr)); }
}
@media (min-width: 72rem) { /* 3×320 + 2×20 = 1000px */
  .feature-grid.columns-3 { grid-template-columns: repeat(3, minmax(20rem, 1fr)); }
}
@media (min-width: 90rem) { /* 4×320 + 3×20 = 1340px */
  .feature-grid.columns-4 { grid-template-columns: repeat(4, minmax(20rem, 1fr)); }
}

Skip navigation link (SkipLink.astro, astro.config.mjs, custom.css)

  • Added SkipLink.astro as a Starlight component override rendering <a href="#_top" class="skip-link">Skip to main content</a>
  • Registered it in astro.config.mjs under components
  • Replaced the old !important-heavy attribute-selector CSS with clean .skip-link rules: off-screen by default (top: -9999px), revealed on :focus

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.astro.build
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node node /home/REDACTED/.npm/_npx/aa98e6899c6baff3/node_modules/.bin/astro build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.

…ion link

- Raise media query breakpoints for columns-3 (50rem→72rem) and columns-4
  (50rem→90rem) in FeatureGrid.astro to prevent content overflow at narrow
  viewports where 3/4 columns cannot fit in the available content area
- Add SkipLink.astro component with WCAG 2.4.1-compliant visually-hidden
  skip navigation link; register it as a Starlight component override
- Replace !important-heavy attribute-selector skip link CSS with clean
  .skip-link class styles in custom.css

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/db5f92e4-6dd8-4467-bcf5-87fbb13fde62
Copilot AI changed the title [WIP] Fix feature grid overflow issue on iPad Pro 11 Fix FeatureGrid 3/4-col overflow on narrow viewports + WCAG 2.4.1 skip link Mar 23, 2026
Copilot AI requested a review from pelikhan March 23, 2026 17:01
@pelikhan pelikhan marked this pull request as ready for review March 23, 2026 17:02
Copilot AI review requested due to automatic review settings March 23, 2026 17:02
@pelikhan pelikhan merged commit 7cf3a91 into main Mar 23, 2026
37 checks passed
@pelikhan pelikhan deleted the copilot/fix-feature-grid-overflow-ipad-pro-11 branch March 23, 2026 17:02
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

Adjusts documentation site responsiveness and accessibility by preventing FeatureGrid multi-column layouts from overflowing on narrower viewports and by adding a dedicated WCAG 2.4.1 skip-to-content link via a Starlight component override.

Changes:

  • Split FeatureGrid column breakpoints into per-column media queries to avoid 3/4-column overflow on mid-width viewports.
  • Added a Starlight SkipLink component override and corresponding .skip-link styling.
  • Registered the new SkipLink override in astro.config.mjs.

Reviewed changes

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

File Description
docs/src/styles/custom.css Replaces attribute-selector skip-link focus styling with a .skip-link class-based implementation.
docs/src/components/SkipLink.astro Introduces a dedicated skip-to-content link component for Starlight override.
docs/src/components/FeatureGrid.astro Updates responsive grid breakpoints for 2/3/4-column configurations.
docs/astro.config.mjs Wires the SkipLink component into Starlight’s components overrides.

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

Comment on lines +5 to +6
Visually hidden until focused via keyboard; moves focus directly to the
main content area, bypassing repeated navigation blocks. -->
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

The doc comment says this link “moves focus directly to the main content area”, but this component is a plain anchor and won’t programmatically move focus (it will only navigate/scroll to the fragment). Please adjust the comment to avoid claiming focus management unless focus is explicitly handled (e.g., by targeting a focusable element).

Suggested change
Visually hidden until focused via keyboard; moves focus directly to the
main content area, bypassing repeated navigation blocks. -->
Visually hidden until focused via keyboard; allows users to jump directly
to the main content area, bypassing repeated navigation blocks. -->

Copilot uses AI. Check for mistakes.
.feature-grid.columns-3 { grid-template-columns: repeat(3, minmax(20rem, 1fr)); }
}

/* 4-col layout: 4 × 320px + 3 × 20px gap = 1340px → activate at 90rem (1440px) */
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

The breakpoint comments don’t match the actual rem values used: e.g. 72rem is 1152px (at 16px base), not 1000px, and 90rem is 1440px, not 1340px. Either update the comments to reflect the true conversions/assumptions (root font size, container vs viewport), or adjust the breakpoints to match the stated pixel thresholds.

Suggested change
/* 4-col layout: 4 × 320px + 3 × 20px gap = 1340pxactivate at 90rem (1440px) */
/* 4-col layout: 4 × 320px + 3 × 20px gap 1340px; activate at 90rem (1440px) to allow
extra room for the content container and avoid edge clipping. */

Copilot uses AI. Check for mistakes.
Comment on lines +31 to 45
/* 2-col layout: 2 × 320px + 20px gap = 660px → activate at 50rem (800px) */
@media (min-width: 50rem) {
.feature-grid.columns-2 { grid-template-columns: repeat(2, minmax(20rem, 1fr)); }
}

/* 3-col layout: 3 × 320px + 2 × 20px gap = 1000px → activate at 72rem (1152px)
At 50rem the Starlight content area is only ~760px, causing the third column to
overflow past the viewport edge and be clipped. */
@media (min-width: 72rem) {
.feature-grid.columns-3 { grid-template-columns: repeat(3, minmax(20rem, 1fr)); }
}

/* 4-col layout: 4 × 320px + 3 × 20px gap = 1340px → activate at 90rem (1440px) */
@media (min-width: 90rem) {
.feature-grid.columns-4 { grid-template-columns: repeat(4, minmax(20rem, 1fr)); }
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

This change is specifically addressing a mid-width overflow regression (~800–1000px), but the existing Playwright responsive coverage (see docs/tests/mobile-responsive.spec.ts form factors) doesn’t exercise that range. Consider adding a viewport around ~900px and asserting no horizontal scrolling on a page that renders FeatureGrid with columns=3/4 to prevent regressions.

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-23

3 participants