Skip to content

Commit b0511c7

Browse files
committed
feat: add skip links for long lists of focusables
1 parent d9c61ce commit b0511c7

File tree

4 files changed

+29
-4
lines changed

4 files changed

+29
-4
lines changed

app/components/CallToAction.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function handleCardClick(event: MouseEvent) {
4242

4343
<template>
4444
<div>
45-
<h2 class="text-lg text-fg uppercase tracking-wider mb-6">
45+
<h2 id="get-involved" class="text-lg text-fg uppercase tracking-wider mb-6">
4646
{{ $t('about.get_involved.title') }}
4747
</h2>
4848

app/pages/about.vue

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,14 @@ function onBeforeToggleHoverCard(event) {
192192

193193
<!-- Sponsors -->
194194
<div class="sponsors-logos">
195-
<h2 class="text-lg text-fg uppercase tracking-wider mb-4">
195+
<h2 id="sponsors" class="text-lg text-fg uppercase tracking-wider mb-4">
196196
{{ $t('about.sponsors.title') }}
197197
</h2>
198+
<a
199+
href="#oss-partners"
200+
class="not-focus:sr-only absolute bg-bg-elevated rounded px-2 py-1 z-1"
201+
>{{ $t('about.skip_sponsors') }}</a
202+
>
198203
<AboutLogoList
199204
:list="SPONSORS"
200205
class="grid grid-cols-2 md:flex md:flex-row md:items-center"
@@ -203,14 +208,17 @@ function onBeforeToggleHoverCard(event) {
203208

204209
<!-- OSS partners -->
205210
<div>
206-
<h2 class="text-lg text-fg uppercase tracking-wider mb-4">
211+
<h2 id="oss-partners" class="text-lg text-fg uppercase tracking-wider mb-4">
207212
{{ $t('about.oss_partners.title') }}
208213
</h2>
214+
<a href="#team" class="not-focus:sr-only absolute bg-bg-elevated rounded px-2 py-1 z-1">{{
215+
$t('about.skip_oss_partners')
216+
}}</a>
209217
<AboutLogoList :list="OSS_PARTNERS" class="items-center" />
210218
</div>
211219

212220
<div>
213-
<h2 class="text-lg uppercase tracking-wider mb-4">
221+
<h2 id="team" class="text-lg uppercase tracking-wider mb-4">
214222
{{ $t('about.team.title') }}
215223
</h2>
216224
<p class="text-fg-muted leading-relaxed mb-6">
@@ -226,6 +234,11 @@ function onBeforeToggleHoverCard(event) {
226234
)
227235
}}
228236
</h3>
237+
<a
238+
href="#get-involved"
239+
class="not-focus:sr-only absolute bg-bg-elevated rounded px-2 py-1 z-1"
240+
>{{ $t('about.skip_contributors') }}</a
241+
>
229242

230243
<div
231244
v-if="contributorsStatus === 'pending'"

i18n/locales/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,9 @@
905905
"title": "About",
906906
"heading": "about",
907907
"meta_description": "npmx is a fast, modern browser for the npm registry. A better UX/DX for exploring npm packages.",
908+
"skip_sponsors": "Skip sponsors list",
909+
"skip_oss_partners": "Skip open source partners list",
910+
"skip_contributors": "Skip contributors list",
908911
"what_we_are": {
909912
"title": "What we are",
910913
"better_ux_dx": "better UX/DX",

i18n/schema.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2719,6 +2719,15 @@
27192719
"meta_description": {
27202720
"type": "string"
27212721
},
2722+
"skip_sponsors": {
2723+
"type": "string"
2724+
},
2725+
"skip_oss_partners": {
2726+
"type": "string"
2727+
},
2728+
"skip_contributors": {
2729+
"type": "string"
2730+
},
27222731
"what_we_are": {
27232732
"type": "object",
27242733
"properties": {

0 commit comments

Comments
 (0)