Skip to content

Commit 78bd02b

Browse files
committed
fix: improve accessibility for links and headings (#8366)
1 parent 40ea071 commit 78bd02b

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

src/components/Layout/HomeContent.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,9 @@ export function HomeContent() {
297297
<div className="absolute inset-0 bg-gradient-right" />
298298
<div className="bg-wash relative h-14 w-full" />
299299
<div className="relative flex items-start justify-center flex-col flex-1 pb-16 pt-5 gap-3 px-5 lg:px-10 lg:pt-8">
300-
<h4 className="leading-tight text-primary font-semibold text-3xl lg:text-4xl">
300+
<h1 className="leading-tight text-primary font-semibold text-3xl lg:text-4xl">
301301
Stay true to the web
302-
</h4>
302+
</h1>
303303
<p className="lg:text-xl leading-normal text-secondary">
304304
People expect web app pages to load fast. On the server,
305305
React lets you start streaming HTML while you’re still
@@ -383,9 +383,9 @@ export function HomeContent() {
383383
</div>
384384
</div>
385385
<div className="flex flex-col items-start justify-center pt-0 gap-3 px-2.5 lg:pt-8 lg:px-8">
386-
<h4 className="leading-tight text-primary dark:text-primary-dark font-semibold text-3xl lg:text-4xl">
386+
<h1 className="leading-tight text-primary dark:text-primary-dark font-semibold text-3xl lg:text-4xl">
387387
Go truly native
388-
</h4>
388+
</h1>
389389
<p className="h-full lg:text-xl text-secondary dark:text-secondary-dark leading-normal">
390390
People expect native apps to look and feel like their
391391
platform.{' '}
@@ -1620,8 +1620,6 @@ function Thumbnail({video}) {
16201620
href={video.url}
16211621
target="_blank"
16221622
rel="noreferrer"
1623-
aria-hidden="true"
1624-
tabIndex={-1}
16251623
className={cn(
16261624
'outline-link dark:outline-link outline-offset-2 aspect-video w-32 xs:w-36 select-none flex-col shadow-inner-border rounded-lg flex items-center overflow-hidden justify-center align-middle text-white/50 bg-cover bg-white bg-[conic-gradient(at_top_right,_var(--tw-gradient-stops))]',
16271625
image === 'blue' && 'from-yellow-50 via-blue-50 to-purple-60',
@@ -1637,6 +1635,7 @@ function Thumbnail({video}) {
16371635
? 'url(' + image + ')'
16381636
: null,
16391637
}}>
1638+
<span className="sr-only">{video.title}</span>
16401639
{typeof image !== 'string' ? (
16411640
<>
16421641
<div className="transition-opacity mt-2.5 -space-x-2 flex flex-row w-full justify-center">

src/components/Layout/Page.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ export function Page({
125125

126126
return (
127127
<>
128+
<a
129+
href="#main"
130+
className="sr-only focus:not-sr-only focus:absolute focus:z-50 focus:p-4">
131+
Skip to main content
132+
</a>
128133
<Seo
129134
title={title}
130135
titleForTitleTag={meta.titleForTitleTag}
@@ -166,7 +171,7 @@ export function Page({
166171
)}
167172
{/* No fallback UI so need to be careful not to suspend directly inside. */}
168173
<Suspense fallback={null}>
169-
<main className="min-w-0 isolate">
174+
<main id="main" className="min-w-0 isolate">
170175
<article
171176
className="font-normal break-words text-primary dark:text-primary-dark"
172177
key={asPath}>

src/content/reference/react/captureOwnerStack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ pre.nowrap {
277277
<p>
278278
<pre id="error-body"></pre>
279279
</p>
280-
<h2 class="-mb-20">Owner Stack:</h4>
280+
<h2 class="-mb-20">Owner Stack:</h2>
281281
<pre id="error-owner-stack" class="nowrap"></pre>
282282
<button
283283
id="error-close"

0 commit comments

Comments
 (0)