Defaulting to Dark Mode on Initial Load in VitePress #2895
-
Hello everyone, I've built a VitePress site it has a toggle for dark/light mode. Currently, the site loads in light mode by default. I'd like to set dark mode as the initial theme when users visit the site. They should then be able to switch to light mode manually if they choose to. Could anyone guide me on how to set dark mode as the default theme on initial load? Any pointers would be greatly appreciated! Thank you in advance! |
Beta Was this translation helpful? Give feedback.
Answered by
brc-dd
Sep 1, 2023
Replies: 1 comment 2 replies
-
Set |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
eyallampel1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Set
appearance: 'dark'
in your config - https://vitepress.dev/reference/site-config#appearance