feat: add automatic color scheme - #1108
Conversation
There was a problem hiding this comment.
Pull request overview
Adds automatic light/dark mode selection so the docs site can follow the user’s OS/browser color-scheme preference (fixes #1099), reducing “flashbang” experiences for dark-mode users.
Changes:
- Enable automatic theme selection by honoring
prefers-color-schemevia DocusauruscolorModeconfiguration.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Svanvith
left a comment
There was a problem hiding this comment.
👍
The automatic theme detection works as expected. If a theme was selected manually before, Docusaurus stores that choice in localStorage, which takes precedence over the system preference. This can make the automatic mode appear not to work, but is expected behavior.
I don't think so. Theme switch has now three states: light, dark and automatic. It's totally expected: if I set the docusarus theme to light while my machine is on dark mode, that the light theme gets rendered and persisted. |
fixes #1099