chakra-ui / chakra-ui-vue

⚡️ Build scalable and accessible Vue.js applications with ease.

Home Page:https://vue.chakra-ui.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Persisting the color mode

sduduzog opened this issue · comments

commented

Is your feature request related to a problem? Please describe.
After switching the color mode from light to dark, refreshing the page lands me back on dark mode. Not only that but the system currently is set to be dark mode but there is no way currently to get that automatically set

Describe the solution you'd like
Color mode should be persisted so that when I leave the site and come back, the color mode is persisted and I don't have to toggle it again. It should also auto detect system settings for setting its default color mode.

Describe alternatives you've considered
So far none...

Additional context
Tailwind has two themes modes, one listens to systems settings and the other is dependant on a class setting, which can be toggled programmatically. https://vueuse.org/core/usedark/ is a utility that's useful for controlling this. I haven't checked if the React variation of this library actually supports this.