Synphonyte / leptos-use

Collection of essential Leptos utilities inspired by React-Use / VueUse
https://leptos-use.rs/
Apache License 2.0
333 stars 78 forks source link

use_color_mode resets the value in local storage to auto, when reloading the page #100

Closed SeraphyBR closed 6 months ago

SeraphyBR commented 6 months ago

I don't know if this is intentional, but I intended to use use_color_mode() to implement a dark mode toggle button on my website, but I noticed that when I reloaded it went back to "auto", which contradicts the idea of persisting. A clear example is in the documentation itself, it is possible to see this behavior.

SeraphyBR commented 6 months ago

https://leptos-use.rs/browser/use_color_mode.html Just click the button to change the theme, and reload the page

maccesch commented 6 months ago

You are right! I can reproduce. Thanks for reporting, I'll fix it ASAP!