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

Is there way not to use system color prefer state as default value? #60

Open
jothachil opened this issue Sep 22, 2020 · 3 comments
Open

Comments

@jothachil
Copy link

if system prefer value is in dark mode the react app by default will start in dark mode is there any way the default value is always light mode?

@djD-REK
Copy link

djD-REK commented Sep 22, 2020 via email

@jothachil
Copy link
Author

@djD-REK Got it. But the edge case here is even if the the default value is false and if system theme preference is set in auto. During the time system switch from light mode -> dark mode the react app will get changed to dark mode. Anyway I can enforce the change in theme is only by user action in the app.

@oririechman
Copy link

oririechman commented Mar 4, 2021

I just modified the matchMedia of the window object to null as a work around

window.matchMedia = null;
const { value } = useDarkMode(true);

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

3 participants