Skip to content

Commit e386954

Browse files
knowlerdanielroe
andauthored
refactor(a11y): add headings to call to action cards (#799)
Co-authored-by: Daniel Roe <daniel@roe.dev>
1 parent 6662ee3 commit e386954

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

app/components/CallToAction.vue

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,31 @@ const socialLinks = computed(() => [
3434
</h2>
3535

3636
<div class="grid gap-4 sm:grid-cols-3 sm:items-stretch sm:grid-rows-[auto,1fr,auto]">
37-
<a
37+
<div
3838
v-for="link in socialLinks"
3939
:key="link.id"
40-
:href="link.href"
41-
target="_blank"
42-
rel="noopener noreferrer"
43-
class="group grid gap-3 p-4 rounded-lg bg-bg-subtle hover:bg-bg-elevated border border-border hover:border-border-hover transition-all duration-200 sm:grid-rows-subgrid sm:row-span-3"
40+
class="group relative grid gap-3 p-4 rounded-lg bg-bg-subtle hover:bg-bg-elevated border border-border hover:border-border-hover transition-all duration-200 sm:grid-rows-subgrid sm:row-span-3 focus-within:ring-2 focus-within:ring-accent/50"
4441
>
45-
<div class="flex gap-2">
42+
<h3 class="z-1 flex gap-2">
4643
<span :class="link.icon" class="shrink-0 mt-1 w-5 h-5 text-fg" aria-hidden="true" />
4744
<span class="font-medium text-fg">
4845
{{ link.titleKey }}
4946
</span>
50-
</div>
51-
<p class="text-sm text-fg-muted leading-relaxed">
47+
</h3>
48+
<p class="z-1 text-sm text-fg-muted leading-relaxed">
5249
{{ link.descriptionKey }}
5350
</p>
54-
<span
55-
class="text-sm text-fg-muted group-hover:text-fg inline-flex items-center gap-1 mt-auto"
51+
<a
52+
:href="link.href"
53+
target="_blank"
54+
rel="noopener noreferrer"
55+
class="text-sm text-fg-muted group-hover:text-fg inline-flex items-center gap-1 mt-auto focus-visible:outline-none"
5656
>
5757
{{ link.ctaKey }}
5858
<span class="i-carbon:arrow-right rtl-flip w-3 h-3" aria-hidden="true" />
59-
</span>
60-
</a>
59+
<span class="absolute z-0 inset-0" aria-hidden="true" />
60+
</a>
61+
</div>
6162
</div>
6263
</div>
6364
</template>

0 commit comments

Comments
 (0)