-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
Would it be possible to handle dark mode differently? #386
Comments
Hi, I would like to just give my opinions on this one. Actually, I think that this should be the website developer responsibility to implement this, not under the responsibility of maintainer as different websites have their own different needs and implementations. I haven't found a CSS library that do this yet on a library-level of implementations. Plus, it would be a hassle to properly maintain this as it will depends on other's library / browser feature. Would also want to hear from others as well. This is only mere my opinions. EDIT : I wouldn't say it is impossible but I'm looking at other library approach. |
As a random (not advanced) user of the library I can say that I am completely happy with the current implementation. A simple example of JS theme-toggle and a list of CSS variables are fine for me |
The idea is to appeal not just to one person but to a wide audience. |
I agree with @Jerit3787 , a framework should leave open how to apply the styles. prefers-color-scheme is used to detect if a user has requested light or dark color themes. A user indicates their preference through an operating system setting (e.g. light or dark mode) or a user agent setting. If the framework had implemented what you said (the "automatic" option)it will conflict with this option. |
I create personal wordpress plugin with materialize and it is default set to dark > make all admin go to dark. How to make default theme to light? I check localstorage and no attribute: theme |
Hi @kenny-nt, you can view this issue for solutions #483. p/s sorry my mistake for default theme, it seems to react based on theme set on the html element
the usage of |
html tag currently do not have attribute theme and it is still dark as default. I tried to edit and add theme="light" > make body to light. Is it should be light as default!? |
I'm not sure why your default theme is dark. The default theme for materialize is light, and you should also be able to switch to dark. If you could provide how the implementations on your side would be appreciated. |
``> > html tag currently do not have attribute theme and it is still dark as default. I tried to edit and add theme="light" > make body to light. Is it should be light as default!?
I just enqueue materialize into an option page of wordpress (wp-admin_ . I dont setup html tag, the default html tag of wordpress admin backend. I checked html tag:
But the page is dark mode... It is not happened with 2.0.4 |
The default theme depends now on the system preferences. If you have set your System to dark mode then Materialize will also render in dark. If you have default light mode, then it will render light. You can override the theme via Javascript. The documentation needs to be updated. And also all the old theme variables are deprecated. We use now directly the M3 vars, because they were already mix up and it was cleaner to use them directly. There is still a lot of work to do, so please contribute. Every support is very welcome! Thanks. |
Before submitting...
Context
The darkmode is not advanced enough in terms of options
Current Behavior
The dark mode option is perfect but deserves to be deepened
Expected behavior
If possible, the ideal would be to be able to activate it as a component
Here are some interesting leads and cool options like:
by the user instead of darkmode depending on the time of day (example "darkmode" between 19pm and 7am otherwise "lightmode", it's just one more condition but very practical).
Possible Solutions or Causes
No response
Your Environment
MaterializeCSS : 2.0.1 alpha
Chrome : Version 114.0.5735.134 (Build officiel) (64 bits)
Windows 11 on desktop
The text was updated successfully, but these errors were encountered: