Skip to content

Commit 6b531d3

Browse files
committed
Make the collapse/expand buttons in the new sidebar more accessible
They’re now marked as toggle buttons with `aria-pressed` and have better labels with `aria-label`.
1 parent cceac68 commit 6b531d3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sidebar/sidebar.stache

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
{{child.shortTitle}}
2323
</a>
2424
{{#if child.isCollapsible}}
25-
<button on:click="child.collapse()">
25+
<button
26+
aria-label="{{#if child.isCollapsed}}Expand{{else}}Collapse{{/if}} section"
27+
aria-pressed="{{#if child.isCollapsed}}false{{else}}true{{/if}}"
28+
on:click="child.collapse()"
29+
>
2630
{{#if child.isCollapsed}}
2731
+
2832
{{else}}

0 commit comments

Comments
 (0)