Skip to content

Commit bcdb981

Browse files
committed
chore: add accessibility warning of links opening in new tabs
1 parent 684d476 commit bcdb981

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/client/App.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ export const App = () => {
178178
rel="noreferrer"
179179
className="font-light text-content-secondary text-sm hover:text-content-primary"
180180
>
181+
<span className="sr-only"> (link opens in new tab)</span>
181182
Coder
182183
</a>
183184
<a
@@ -186,6 +187,7 @@ export const App = () => {
186187
rel="noreferrer"
187188
className="font-light text-content-secondary text-sm hover:text-content-primary"
188189
>
190+
<span className="sr-only"> (link opens in new tab)</span>
189191
Docs
190192
</a>
191193
<ExampleSelector />
@@ -325,6 +327,7 @@ const ExampleSelector: FC = () => {
325327
return (
326328
<DropdownMenuItem key={slug} asChild={true}>
327329
<a href={href} target="_blank" rel="noreferrer">
330+
<span className="sr-only"> (link opens in new tab)</span>
328331
<ExternalLinkIcon />
329332
{title}
330333
</a>

src/client/Preview.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ const PreviewEmptyState = () => {
244244
rel="noreferrer"
245245
className="flex items-center gap-0.5 text-content-link text-sm"
246246
>
247+
<span className="sr-only"> (link opens in new tab)</span>
247248
Read the docs
248249
<span className="inline">
249250
<ExternalLinkIcon width={16} />

0 commit comments

Comments
 (0)