Skip to content

Commit bd37234

Browse files
committed
a11y: add skip to main content navigation link (WCAG 2.4.1)
1 parent f3d9794 commit bd37234

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/components/Layout/Page.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ export function Page({
154154
</Head>
155155
)}
156156
{/* <SocialBanner /> */}
157+
<a
158+
href="#main-content"
159+
className="sr-only focus:not-sr-only focus:fixed focus:top-2.5 focus:start-2.5 focus:z-50 focus:px-4 focus:py-2 focus:bg-card focus:dark:bg-card-dark focus:text-link focus:dark:text-link-dark focus:rounded-lg focus:shadow-md focus:outline-none focus:ring-2 focus:ring-link">
160+
Skip to main content
161+
</a>
157162
<TopNav
158163
section={section}
159164
routeTree={routeTree}
@@ -177,7 +182,7 @@ export function Page({
177182
)}
178183
{/* No fallback UI so need to be careful not to suspend directly inside. */}
179184
<Suspense fallback={null}>
180-
<main className="min-w-0 isolate">
185+
<main id="main-content" className="min-w-0 isolate">
181186
<article
182187
className="font-normal break-words text-primary dark:text-primary-dark"
183188
key={asPath}>

0 commit comments

Comments
 (0)