diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 3939a82ad67..acba93764e6 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -140,6 +140,7 @@ export default defineConfig({ }, components: { Head: './src/components/CustomHead.astro', + SkipLink: './src/components/SkipLink.astro', SocialIcons: './src/components/CustomHeader.astro', ThemeSelect: './src/components/ThemeToggle.astro', Footer: './src/components/CustomFooter.astro', diff --git a/docs/src/components/FeatureGrid.astro b/docs/src/components/FeatureGrid.astro index d43671f02cd..4df093395c0 100644 --- a/docs/src/components/FeatureGrid.astro +++ b/docs/src/components/FeatureGrid.astro @@ -28,9 +28,20 @@ const { columns = 2 } = Astro.props; grid-template-columns: 1fr; } + /* 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)); } } diff --git a/docs/src/components/SkipLink.astro b/docs/src/components/SkipLink.astro new file mode 100644 index 00000000000..afd587553ae --- /dev/null +++ b/docs/src/components/SkipLink.astro @@ -0,0 +1,7 @@ +--- +--- + + + diff --git a/docs/src/styles/custom.css b/docs/src/styles/custom.css index d60c44d846d..5966b30ec96 100644 --- a/docs/src/styles/custom.css +++ b/docs/src/styles/custom.css @@ -95,26 +95,29 @@ animation: light-glow-move 20s ease-in-out infinite; } -/* Skip to Content Link - Enhanced Accessibility */ -/* Override Starlight's default skip link styles for better visibility */ -a[href*="#"][href$="_top"]:focus, -a[href*="#overview"]:focus:first-child { - clip: auto !important; - clip-path: none !important; - position: fixed !important; - top: 1rem !important; - left: 1rem !important; - z-index: 9999 !important; - padding: 1rem 1.5rem !important; - background-color: var(--sl-color-accent) !important; - color: var(--sl-color-text-invert) !important; - text-decoration: none !important; - font-weight: 600 !important; - font-size: 1rem !important; - border-radius: 0.5rem !important; - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important; - outline: 3px solid var(--sl-color-accent-high) !important; - outline-offset: 2px !important; +/* Skip to Content Link - Enhanced Accessibility (WCAG 2.4.1) */ +/* The .skip-link is visually hidden until focused via keyboard, then revealed. */ +.skip-link { + position: absolute; + top: -9999px; + left: 0; + z-index: 9999; + padding: 1rem 1.5rem; + background-color: var(--sl-color-accent); + color: var(--sl-color-text-invert); + text-decoration: none; + font-weight: 600; + font-size: 1rem; + border-radius: 0.5rem; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); + outline: 3px solid var(--sl-color-accent-high); + outline-offset: 2px; + white-space: nowrap; +} + +.skip-link:focus { + top: 1rem; + left: 1rem; } /* Mermaid diagram colors @@ -1629,7 +1632,7 @@ main, /* Mobile-specific: Additional touch target improvements for remaining elements */ @media (max-width: 768px) { /* Skip to content link - accessibility feature */ - a[href="#_top"], + .skip-link, a[class*="skip"] { min-height: 44px !important; min-width: 44px !important;