-
I want to disable the color mode toggle and only support the dark theme. colorMode: {
defaultMode: 'dark',
disableSwitch: true,
respectPrefersColorScheme: false,
}, The above config results in removing the theme toggle, but keeps using the light theme. I don't want to override the CSS config of the light-theme with dark-theme config, because I want to keep the CSS config for the future in case I decide to enable that button. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Not 100% sure but I think this is a bundler caching issue. Running Edit: yes it really looks like a hot reload problem. Some of our Docusaurus config changes unfortunately require to restart the dev server. See this repro, it shows dark mode for me: https://stackblitz.com/edit/github-krhxqbh7?file=docusaurus.config.ts |
Beta Was this translation helpful? Give feedback.
-
You're right, it is the hot reload issue. After restarting the server, the toggle is removed, and the dark more is applied. Than you! |
Beta Was this translation helpful? Give feedback.
Not 100% sure but I think this is a bundler caching issue. Running
docusaurus clear
and restarting/rebuilding will lead to the right dark color mode. Or maybe you just need to restart the dev server?Edit: yes it really looks like a hot reload problem. Some of our Docusaurus config changes unfortunately require to restart the dev server.
See this repro, it shows dark mode for me: https://stackblitz.com/edit/github-krhxqbh7?file=docusaurus.config.ts