Replies: 1 comment 3 replies
-
import { useDarkMode } from '@vuepress/theme-default/lib/client'
import { watch } from 'vue'
export default {
setup() {
const isDarkMode = useDarkMode()
watch(isDarkMode, () => {
// ...
})
},
} |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
meteorlxy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Tried watching prefers-color-scheme from this answer but is not triggered.
Looked up the docs and also couldn't find anything, so I was wondering is there a way do detect when user switch dark/light mode?
Beta Was this translation helpful? Give feedback.
All reactions