From a872390892bf88c438f72f1b42f7f8aa195f79e7 Mon Sep 17 00:00:00 2001 From: Manish Kumar Gupta Date: Thu, 22 Aug 2024 13:37:05 -0700 Subject: [PATCH] Prettify --- src/utils/index.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/utils/index.ts b/src/utils/index.ts index 27c414ce..add07778 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -163,12 +163,14 @@ export const a11yPostProcessDom = (dom: Document) => { .xr-section-item input { opacity: 0; } - ` + `; // Add the style to the DOM var styleElement = document.createElement("style"); styleElement.textContent = style; - dom.querySelector(".xr-wrap")?.insertBefore(styleElement, dom.querySelector(".xr-header")); - + dom. + querySelector(".xr-wrap") + ?.insertBefore(styleElement, dom.querySelector(".xr-header")); + // Add role=checkbox to the xr-section-summary labels dom.querySelectorAll("label.xr-section-summary").forEach(el => { el.setAttribute("role", "checkbox"); @@ -179,10 +181,11 @@ export const a11yPostProcessDom = (dom: Document) => { }); // The xr-sections grid layout will now have 8 columns (2 for hidden checkboxes) dom.querySelectorAll(".xr-sections").forEach(el => { - (el as HTMLElement).style.gridTemplateColumns = "150px auto auto 1fr 0 20px 0 20px"; + (el as HTMLElement).style.gridTemplateColumns = + "150px auto auto 1fr 0 20px 0 20px"; }); // End: Keyboard navigation for xarray - + //

tags with role="heading" need an aria-level attribute dom .querySelectorAll("p[role=heading]")