From: Patrick H. Lauke Date: Mon, 2 Jan 2023 05:54:46 +0000 (+0000) Subject: Docs: Make theme switcher accessible (#37780) X-Git-Tag: v5.3.0-alpha2~197 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=212c0dfd076e4e504de135b2b41647199feb3696;p=thirdparty%2Fbootstrap.git Docs: Make theme switcher accessible (#37780) * Make theme switcher accessible * set an explicit `aria-label` to the switcher (as the `` is not sufficient, as it can be display:none'd and then the button has no accName) * make the theme buttons actual `aria-pressed` toggles * Dynamically update aria-label for theme switcher * Explicitly reset focus after activating theme * Use innerText for the constructed dynamic aria-label this way, if the text ever gets changed in the html, this will adapt appropriately * Tweak accessible name for the dropdown * Fixup * Use `textContent` instead of `innerText` --- diff --git a/site/layouts/partials/docs-navbar.html b/site/layouts/partials/docs-navbar.html index 4b942a65e7..2795ec85b7 100644 --- a/site/layouts/partials/docs-navbar.html +++ b/site/layouts/partials/docs-navbar.html @@ -90,27 +90,28 @@ type="button" aria-expanded="false" data-bs-toggle="dropdown" - data-bs-display="static"> + data-bs-display="static" + aria-label="Toggle theme (auto)"> - Toggle theme + Toggle theme -