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

Dark mode support via automatic CSS media query prefers-color-scheme #326

Open
tonimelisma opened this issue Oct 28, 2020 · 1 comment
Open

Comments

@tonimelisma
Copy link

Hey,

all major browsers have supported the prefers-color-scheme CSS media query for over a year now. Would it be a good idea for mui to also support this functionality? In essence the web site would have two themes, a light and a dark, and the end user's browser chooses automatically which one to use based on user preference and/or system settings.

If this functionality is welcome, any tips on how to implement it?

@amorey
Copy link
Member

amorey commented Dec 19, 2020

Sure! That would be useful. Maybe there's a better way but I think the cleanest way to implement it is using css variables. Unfortunately this would break IE11 support so we'd also have to release it as a major version.

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