nuxt-modules / color-mode

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

Flash with SSR #166

Closed FayKn closed 2 years ago

FayKn commented 2 years ago

Version

@nuxtjs/color-mode: 3.1.7 nuxt: v3.0.0 rc.11

Steps to reproduce

https://stackblitz.com/edit/nuxt-color-mode-7trxex?file=pages/index.vue

SSR on, set page to light mode, open 2 other pages; This will make the color preference flash between light and system

What is Expected?

That it'd go to what the inital page was and use light mode

What is actually happening?

Mode is flashing between system and light, this is worse in the actual project where it'll be in an infinite loop of flashing

FayKn commented 2 years ago

Seems to be fixed on RC.12, thanks for the great work