Skip to content

Respect system color-scheme preference as default theme - #377

Merged
fxck merged 2 commits into
mainfrom
fix/color-mode-url-theme-override
Sep 18, 2026
Merged

fxck merged 2 commits into
mainfrom
fix/color-mode-url-theme-override

Conversation

@Edward-Deakin

@Edward-Deakin Edward-Deakin commented Sep 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Default theme now falls back to the visitor's OS prefers-color-scheme setting instead of hardcoding light mode when there's no saved theme in localStorage and no docusaurus-theme URL override.
  • Builds on the previous fix for the docusaurus-theme URL param, which still takes priority, followed by any saved localStorage preference.

Test plan

  • yarn build:js:esm passes in packages/docs-ui
  • Verify in a browser with OS set to dark mode and no prior visit (clear localStorage) that the site loads in dark mode
  • Verify ?docusaurus-theme=light still overrides system dark preference
  • Verify a previously saved localStorage preference still takes priority over system preference

馃 Generated with Claude Code

Edward-Deakin and others added 2 commits August 25, 2026 15:50
Previously defaulted to light mode for first-time visitors with no
saved preference or URL override, ignoring their OS dark-mode setting.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BvvYGNDv99R4wyjwanLMrB
@fxck
fxck merged commit 06225c9 into main Sep 18, 2026
2 checks passed
@fxck
fxck deleted the fix/color-mode-url-theme-override branch September 18, 2026 13:30
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.

2 participants