-
-
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
[DRAFT] added prototype styling for dark theme support #254
Conversation
New changes:
|
…agination, collection, breadcrumbs
@materializecss/members we need some reviews. |
wait, is this still draft or no? 😅 |
This is awesome, this feature should be merged and then continued from there. I suggest to merge into the v2 branch. |
Hi @Smankusors to be honest, I don't fully remember the state here 😅 But I would still like to get feedback on the code changes and restyling of existing components (see #254 (comment)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, maybe add some documentation.
Also a section how to adapt the variables or add another theme would be helpful, if that is possible. Otherwise, it looks nice!
@bugy just as a sidenote for future PRs: best-.practice for commit messages is to use present-tense, like "add ...", "change ...", "implement ..." instead of "added ..." and so on. |
…pendant on theme
Nice! This is getting lit 🔥 |
…cording to docs
…material guideline
Hey @bugy! Nice commits, when is this ready to merge? Are all components covered? |
Hi @wuda-io it's still work in progress. I don't have too much time, do doing tiny steps Btw, with this refactoring, there comes a question: which components should have accent (secondary) color. As per material guideline, it should be FAB, sliders and switches. However I'm the current codebase it's quite random, i would say. Should i keep it as it is, or we use this opportunity to align color scheme? |
…or style fixes
I think I'm done with the changes :) Now we need to decide:
@DanielRuf who can answer those questions? I built the material demo pages, feel free to test: I used |
Hello @bugy I asked the other members how we should handle the merging of this PR, since it would be a nice step forward. |
Oh shit! Sorry I accidently clicked on Ready for Review, I did not know that this changed the PR State. How can I undo this action? Sorry @bugy I wanted to see the changes and would be ready to got them through if you are ready. |
@wuda-io there should be a button to convert to draft on the right pane :) |
|
||
// Made less specific to allow easier overriding | ||
.secondary-content { | ||
float: right; | ||
color: $secondary-color; | ||
color: $primary-color; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats here the usage of primary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw that you changed that other places too.
I assume you first had primary and then adapted for a better appearance.
Or was this due to the material specs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I tried to align everything to materialize specs, where they use primary color almost everywhere, and secondary color is used only as accent for important actions (like floating action button)
p { color: $slider-bg-color-light; } | ||
p { | ||
color: rgba(255, 255, 255, 0.75); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the class .slides
set? From noUISlider? I did not find any usage for this class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's from noUISlider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty much lines to read 😆 Looks good after all!
I would merge that 👍
I will check it out at my local project and then see how we have to adapt the documentation for this. |
Sry guys for being inactive here :) Didn't have time for it recently |
Proposed changes
Here is a prototype of basic dark theme support. Theme variables are defined in sass/components/_theme_variables.css
By default
:root
variables are applied. If atheme = dark
attribute added todocument
, then dark variables are picked up. In this way it would be possible to have even more than 2 themes per application if neededI decided not to use css variables in scss files directly, but put them in scss variables (e.g.
$bg-color: var(--background-color) !default;
), this would be less breaking for users, who work with custom scss variables in their projectsI also adjusted tab/switch styling to better reflect material UI guidelines (and to use fewer variables).
If we would like to continue with this approach, I would kindly ask to merge #85 first, because there are quite some intersecting changes
Here is the testbed, which I used: https://materialize-testbed.s3-us-west-2.amazonaws.com/dark-theme/index.html#!
You can find theme switch in the right upper corner
The switch theme code looks like this:
Screenshots (if appropriate) or codepen:
Types of changes
It might be a breaking change for users, who override sass variables.
Also, it would change a look of some components (to better match material UI guidelines)
Checklist: