Skip to content

infra(nav): replace theme dropdown with icon toggle button#155

Merged
marc0olo merged 1 commit into
mainfrom
infra/theme-toggle-button
Apr 28, 2026
Merged

infra(nav): replace theme dropdown with icon toggle button#155
marc0olo merged 1 commit into
mainfrom
infra/theme-toggle-button

Conversation

@marc0olo
Copy link
Copy Markdown
Member

Summary

  • Replaces Starlight's default ThemeSelect dropdown with a single icon-toggle button
  • Light mode shows a moon icon (click → go dark); dark mode shows a sun icon (click → go light)
  • CSS toggles icon visibility via [data-theme] — no flash on switch
  • aria-label updates on each click for screen reader accuracy
  • Drops the auto option: ThemeProvider already hard-codes light as default and never reads prefers-color-scheme, so the three-option dropdown was misleading
  • localStorage key (starlight-theme) is unchanged — existing user preferences carry over

Sync recommendation

hand-written

Overrides Starlight's ThemeSelect with a single sun/moon button.
Drops the three-option select (light/dark/auto) since ThemeProvider
already hard-codes light as default and never uses auto. One click
instead of two; aria-label updates on each toggle for accessibility.
@marc0olo marc0olo merged commit 55cd994 into main Apr 28, 2026
1 check passed
@marc0olo marc0olo deleted the infra/theme-toggle-button branch April 28, 2026 12:19
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.

1 participant