Skip to content

Select dark mode by default #571

Answered by Mister-Hope
fsproru asked this question in Q&A
Discussion options

You must be logged in to vote

Currently, no.

Here is a possible workaround:

  1. Disable the darkmode feature by setting themeConfig.darkmode: 'disable'
  2. Add a clientRootMixin with a mounted lifetime to add theme-dark class on body.
export default {
  mounted(){
    document.body.classList.add('theme-dark');
  }
}

I may support this in the next version, but I will take a careful look on letting the SSR render the dark-theme by default after setting an optin while remaining the rest feature working.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Mister-Hope
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants