nuxt-modules / color-mode

Dark and Light mode with auto detection made easy with Nuxt 🌗
https://color-mode.nuxtjs.org
MIT License
1.09k stars 101 forks source link

Color mode is reset when navigating across pages #167

Closed huang-julien closed 1 year ago

huang-julien commented 1 year ago

Hi :wave: , i'm not sure if this is due to a misconfiguration or not, the module automatically set the color mode to the default value when changing pages.

Version

@nuxtjs/color-mode: 3.1.6 nuxt: 3 rc11

Reproduction Link

https://stackblitz.com/edit/nuxt-starter-tmdxaj?file=tailwind.config.ts,pages%2Findex.vue,pages%2Fhello.vue,app.vue,nuxt.config.ts,.gitignore

Steps to reproduce

What is Expected?

the color mode should be kept on light

What is actually happening?

the color mode has been reset to dark

EDIT: after checking the localStorage, the value is not being changed when changing the colormode

huang-julien commented 1 year ago

closing, was setting the value on .value instead of preference