Skip to content

Commit 0ce0b1b

Browse files
committed
Improve FAQ semantics and a11y
1 parent cecf607 commit 0ce0b1b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

resources/presets/faq/resources/views/page_builder/_faq.antlers.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
hash: '#{{ title | slugify }}'
4848
}"
4949
role="region"
50+
aria-label="{{ title }}"
5051
class="flex flex-col rounded-lg bg-white shadow py-3 px-2 md:px-6"
5152
id="{{ title | slugify }}"
5253
>
@@ -63,7 +64,7 @@
6364
class="px-2 w-full flex items-start justify-between rounded text-neutral hover:text-primary motion-safe:transition"
6465
x-cloak
6566
>
66-
{{ partial:typography/h2 :content="title" color="text-current text-left" class="my-2" }}
67+
{{ partial:typography/h2 as="span" :content="title" color="text-current text-left" class="my-2" }}
6768
<span x-show="expanded" aria-hidden="true" class="flex-shrink-0 font-bold text-lg ml-4">&minus;</span>
6869
<span x-show="!expanded" aria-hidden="true" class="flex-shrink-0 font-bold text-lg ml-4">&plus;</span>
6970
</button>
@@ -72,6 +73,7 @@
7273
x-collapse
7374
class="p-2"
7475
>
76+
<h2 class="sr-only">{{ label }}</h2>
7577
{{ partial:typography/prose }}
7678
{{ text }}
7779
{{ /partial:typography/prose }}

0 commit comments

Comments
 (0)