Add "System" to dark mode switcher
under review
Felipe Santos
I believe the user needs to have three options to select: Light, Dark, and System.
I just saw this on https://monorepo.tools/ and I immediately noticed that Docusaurus could also do the same.
Currently, if a user toggles the theme, it becomes "chosen by the user", and to revert to "chosen by the system", they need to clean cookies, right? Not optimal, I think.
What do you guys think?
Joshua Chen
under review
Joshua Chen
FWIW, this is already made possible in user-land in the latest version, so as not to block users from implementing it themselves. After swizzling
ColorModeToggle
, you can use setColorMode(null)
to revert it back to the system theme. cf (currently unpublished) docs: https://deploy-preview-7382--docusaurus-2.netlify.app/docs/api/misc/@docusaurus/theme-common/#useColorModeRahul Gupta
+1 MDN is doing the same