Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to clear selected mode to let device preference take control #31

Open
saitonakamura opened this issue Aug 25, 2021 · 2 comments
Open

Comments

@saitonakamura
Copy link

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

@jjranalli
Copy link
Owner

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

@saitonakamura
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants