Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options to force dark mode as default theme? #1359

Closed
lslzl3000 opened this issue Sep 18, 2022 · 2 comments · Fixed by #1498
Closed

Options to force dark mode as default theme? #1359

lslzl3000 opened this issue Sep 18, 2022 · 2 comments · Fixed by #1498
Labels
enhancement New feature or request theme Related to the theme

Comments

@lslzl3000
Copy link

Is there any way to force dark color theme as default one, even if the user system preference is lightmode?

@kiaking
Copy link
Member

kiaking commented Sep 20, 2022

We don't have this feature at the moment, but sounds like a nice to have 👍 Maybe appearance option could take 'light' | 'dark' as an option and make it default?

@kiaking kiaking added enhancement New feature or request theme Related to the theme labels Sep 20, 2022
@innocenzi
Copy link
Contributor

I PR'd #1498 to support this feature. In the meantime, my workaround is to add the following to my config's head:

['script', {}, 'window?.localStorage?.setItem("vitepress-theme-appearance", window?.localStorage?.getItem("vitepress-theme-appearance") ?? "dark")'],

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request theme Related to the theme
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants