Skip to content

Commit 5d8ffd2

Browse files
Add skip to main content navigation link for accessibility
1 parent 46a54e0 commit 5d8ffd2

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-4 focus:start-4 focus:z-50 focus:px-4 focus:py-2 focus:bg-brand focus:text-white dark:focus:bg-brand-dark dark:focus:text-gray-95 focus:shadow-md focus:rounded-lg focus:outline-none">
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)