No way to clear selected mode to let device preference take control
saitonakamura opened this issue · 2 comments
Bit of a context: I'm a heavy user of device preferences that changes by time of the day, and with the current helper once you've set a localStorage item, you're pretty much locked in and device preferences cannot affect it
I see that there's a code under // Old
comment that do this stuff but it looks like is not playing well enough with the new one
I suggest some method like clearPreference
Hi – The idea behind the current implementation is that no preference is saved in localStorage until the user presses the button. However I agree with what you said, there are cases where prefers-color-scheme
is preferred.
A clearPreference
method seems like a reasonable solution which I'll consider for the next release (feel free to make a PR), but any suggestion on how to improve Nightwind's default behaviour would also be appreciated
Thanks for the answer! As for the PR I'm still experimenting with the api and trying to figure out how to best cover the api surface.