Skip to content

Theme toggler: localize assistive text, fix stale aria-label - #2758

Merged
chalin merged 13 commits into
google:mainfrom
chalin:chalin-m24-theme-toggler-aria-2026-0829
Aug 29, 2026
Merged

Theme toggler: localize assistive text, fix stale aria-label#2758
chalin merged 13 commits into
google:mainfrom
chalin:chalin-m24-theme-toggler-aria-2026-0829

Conversation

@chalin

@chalin chalin commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

chalin added 2 commits August 29, 2026 06:22
- 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 chalin added this to the 0.17.0 milestone Aug 29, 2026
@chalin
chalin marked this pull request as ready for review August 29, 2026 10:44
chalin added 2 commits August 29, 2026 06:48
- 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)
@chalin chalin changed the title Theme toggler: localize aria text, update aria-label on scheme switch Theme toggler: localize assistive text, fix stale aria-label Aug 29, 2026
chalin added 8 commits August 29, 2026 07:18
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
@chalin
chalin merged commit 8c836d8 into google:main Aug 29, 2026
18 checks passed
@chalin
chalin deleted the chalin-m24-theme-toggler-aria-2026-0829 branch August 29, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

theme-toggler: localize aria text and fix stale aria-label

1 participant