Theme toggler: localize assistive text, fix stale aria-label - #2758
Merged
chalin merged 13 commits intoAug 29, 2026
Conversation
- Adds a `ui_theme_toggle` key across all locales for the toggler's assistive text - Restores the visually hidden `#bd-theme-text` span so dark-mode.js updates the button's aria-label on scheme switch - Uses the selected menu item's localized label in the updated aria-label instead of the raw scheme value
chalin
marked this pull request as ready for review
August 29, 2026 10:44
- The 0.13.0 FOUC item cited google#2332, the Turkish-locale PR; the FOUC work is google#2343 - With the collision gone, the 0.17.0 entry uses a plain [google#2332][] ref - Fixes the google#2331/google#2332 def URLs to their /pull/ paths (were redirect-only /issues/ paths)
Prior-art vet (Starlight, Hextra, Docusaurus): all avoid "Design" for this control, using the Darstellung/Farbschema/Ansicht family
Gives the icon-only button a sighted-user affordance (Docusaurus prior art; footer-links pattern in-repo); computed once and set alongside aria-label at both sites, so the two can't drift
- Fixture render (en+fr): aria-label/title carry the localized "toggle (mode)" name, and the visually hidden sentinel span dark-mode.js keys on is present - Locale coverage: every bundled locale defines ui_theme_toggle - Signal proven red-first: a sabotaged fr expectation fails the fr assertion only
This was referenced Aug 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
title, giving the icon-only button a mouse-user affordance (Docusaurus prior art)aria-label: restores the visually hidden span thatdark-mode.jskeys on (its absence is why the label never updated); the refreshed label reuses the menu items' localized textpr2332label was papering over