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

Support OS preference for light or dark mode #2

Open
4 tasks
willpower232 opened this issue Feb 16, 2019 · 2 comments
Open
4 tasks

Support OS preference for light or dark mode #2

willpower232 opened this issue Feb 16, 2019 · 2 comments

Comments

@willpower232
Copy link
Owner

willpower232 commented Feb 16, 2019

Unfortunately I don't have direct access to this OS feature so this is more of a to-do. If not directly set, the default result should be dark mode.

  • Make light_mode boolean nullable as a third state to allow the app to use auto detection

  • Refer to https://www.kirupa.com/tricks/dealing_with_dark_mode.htm and add javascript to update light mode with OS setting change

  • Create API endpoint to set light mode from javascript and save as a session value then update the view composer to use the session value if the user value is null

  • Update toggle in profile to use indeterminate state and set the value to null in existing api endpoint then add in session value setting and figure how to determine what the actual light_mode state should be

@willpower232
Copy link
Owner Author

@willpower232
Copy link
Owner Author

Seems like its supported now, can use something like matchMedia('(prefers-color-scheme: dark)').matches natively.

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

1 participant