Watch for dark-/lightmode change #1849
Replies: 1 comment 1 reply
-
import { useData } from 'vitepress'
const { isDark } = useData()
// isDark.value |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
MarkusKeck
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a custom
.vue
Component which gets used in vitepress. Inside this component is a canvas element. When I change the color of the page I need to know when a user changed the mode from dark/light so I can redraw the canvas. What would be the easiest way to make a watcher for the DarkLightMode toggle?Beta Was this translation helpful? Give feedback.
All reactions