Skip to content

Commit b440e1c

Browse files
committed
tools: add navigation ARIA landmark to generated API ToC
As an accessibility improvement, specify the navigation landmark for the element of our docs that contains the table of contents generated for the specific API page. Ref: https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/ Ref: https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA20.html
1 parent 0dfb5bf commit b440e1c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/doc/html.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ export function buildToc({ filename, apilinks }) {
467467
.use(htmlStringify)
468468
.processSync(toc).toString();
469469

470-
file.toc = `<details id="toc" open><summary>Table of contents</summary>${inner}</details>`;
470+
file.toc = `<details role="navigation" id="toc" open><summary>Table of contents</summary>${inner}</details>`;
471471
file.tocPicker = `<div class="toc">${inner}</div>`;
472472
} else {
473473
file.toc = file.tocPicker = '<!-- TOC -->';

0 commit comments

Comments
 (0)