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

UserPreferences: Handle in-app dark mode setting being different to OS-level setting #49

Open
phoglenix opened this issue Feb 14, 2022 · 1 comment
Assignees

Comments

@phoglenix
Copy link
Collaborator

Problem:
Web apps often have their own setting/toggle for enabling a dark theme. When they do this, it's independent of the OS-level dark mode setting, and usually set via JS once the web content loads.
This can cause the same problem, in reverse, as this API seeks to solve: the web app loads with one theme/background colour, then switches to another upon load.

I'm not sure what a good solution to this issue would be. Perhaps web apps need a way to inform the OS that they are in dark/light/default mode, so that they will be created with their correct colours instead of using the OS dark/light setting if desired.

@phoglenix
Copy link
Collaborator Author

I think the probable solution to this is a non-declarative (ie. JS) API that lets the app inform the OS that the user has set it to override the OS-level settings (eg. overrideUserPreference("color-scheme" "dark") ). This should not affect the shape of the declarative manifest entries though, so ok to defer until requested by developers.

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

No branches or pull requests

2 participants