-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add support for vuetify theming #262
Add support for vuetify theming #262
Conversation
Oh, and by the way, the current background layers seem too bright for the dark theme. Is there any dark themed layer that anyone can point me to? It would look cool to switch layers when switching themes 😄 |
@ntma thanks for your work so far - the screenshot look fancy! |
I see. Well, in that case would it be appropriate to add an attribute that identifies which layers to use in dark mode? Material design advises the use of light colors to contrast with the dark background/surface color. I think in some cases, the floating buttons over the map canvas will blend with the bright colors of the background layers. |
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.
Only a small comment so far
@ntma the change of the recorder looks fine to me |
Current setup tested with the following material studies:
Basil"theme": {
"dark": false,
"themes": {
"light": {
"primary": "#356859",
"onprimary": "#ffffff",
"secondary": "#FD5523",
"onsecondary": "#ffffff",
"onsurface": "#3b7867",
"accent": "#ffffff"
},
"dark": {
"primary": "#272727",
"onprimary": "#ffffff",
"secondary": "#8bcbb2",
"onsecondary": "#272727",
"onsurface": "#1e1e1e",
"accent": "#8bcbb2"
}
},
"options": {
"customProperties": true
}
}, Crane"theme": {
"dark": false,
"themes": {
"light": {
"primary": "#5D1049",
"onprimary": "#ffffff",
"secondary": "#E30425",
"onsecondary": "#ffffff",
"onsurface": "#720D5D",
"accent": "#ffffff"
},
"dark": {
"primary": "#272727",
"onprimary": "#ffffff",
"secondary": "#ce82ab",
"onsecondary": "#272727",
"onsurface": "#1e1e1e",
"accent": "#ce82ab"
}
},
"options": {
"customProperties": true
}
}, Fortnightly"theme": {
"dark": false,
"themes": {
"light": {
"primary": "#6c38fb",
"onprimary": "#ffffff",
"secondary": "#6c38fb",
"onsecondary": "#ffffff",
"onsurface": "#8759fd",
"accent": "#ffffff"
},
"dark": {
"primary": "#272727",
"onprimary": "#ffffff",
"secondary": "#bda2fe",
"onsecondary": "#272727",
"onsurface": "#1e1e1e",
"accent": "#bda2fe"
}
},
"options": {
"customProperties": true
}
}, Owl"theme": {
"dark": false,
"themes": {
"light": {
"primary": "#FFDE03",
"onprimary": "#000000",
"secondary": "#0336FF",
"onsecondary": "#ffffff",
"onsurface": "#f6e900",
"accent": "#000000"
},
"dark": {
"primary": "#272727",
"onprimary": "#ffffff",
"secondary": "#aa9cfe",
"onsecondary": "#272727",
"onsurface": "#1e1e1e",
"accent": "#aa9cfe"
}
},
"options": {
"customProperties": true
}
}, Rally"theme": {
"dark": true,
"themes": {
"light": {
"primary": "#1EB980",
"onprimary": "#ffffff",
"secondary": "#045D56",
"onsecondary": "#ffffff",
"onsurface": "#58c596",
"accent": "#ffffff"
},
"dark": {
"primary": "#1EB980",
"onprimary": "#ffffff",
"secondary": "#045D56",
"onsecondary": "#ffffff",
"onsurface": "#58c596",
"accent": "#ffffff"
}
},
"options": {
"customProperties": true
}
}, Shrine"theme": {
"dark": false,
"themes": {
"light": {
"primary": "#FEDBD0",
"onprimary": "#000000",
"secondary": "#FEEAE6",
"onsecondary": "#000000",
"onsurface": "#ffd0ba",
"accent": "#ffffff"
},
"dark": {
"primary": "#272727",
"onprimary": "#ffffff",
"secondary": "#ffc2ae",
"onsecondary": "#272727",
"onsurface": "#1e1e1e",
"accent": "#ffc2ae"
}
},
"options": {
"customProperties": true
}
}, |
Update for themes that didn't pass the validation before:
Owl"theme": {
"dark": false,
"themes": {
"light": {
"primary": "#FFDE03",
"onprimary": "#000000",
"secondary": "#0336FF",
"onsecondary": "#ffffff",
"onsurface": "#f6e900",
"accent": "#000000"
},
"dark": {
"primary": "#272727",
"onprimary": "#ffffff",
"secondary": "#faf493",
"onsecondary": "#272727",
"onsurface": "#1e1e1e",
"accent": "#faf493"
}
},
"options": {
"customProperties": true
}
}, Rally"theme": {
"dark": true,
"themes": {
"light": {
"primary": "#045D56",
"onprimary": "#ffffff",
"secondary": "#1EB980",
"onsecondary": "#000000",
"onsurface": "#026d65",
"accent": "#ffffff"
},
"dark": {
"primary": "#272727",
"onprimary": "#ffffff",
"secondary": "#1EB980",
"onsecondary": "#272727",
"onsurface": "#1e1e1e",
"accent": "#1EB980"
}
},
"options": {
"customProperties": true
}
}, Shrine"theme": {
"dark": false,
"themes": {
"light": {
"primary": "#FEDBD0",
"onprimary": "#442C2E",
"secondary": "#FEEAE6",
"onsecondary": "#442C2E",
"onsurface": "#ffd0ba",
"accent": "#442C2E"
},
"dark": {
"primary": "#272727",
"onprimary": "#ffffff",
"secondary": "#ffc2ae",
"onsecondary": "#272727",
"onsurface": "#1e1e1e",
"accent": "#ffc2ae"
}
},
"options": {
"customProperties": true
}
}, |
Hi @JakobMiksch, I added a few more fixes to account color schemes that use a light color as primary color. The default color for text/icons is white but in this case we want it to be a dark tone for the primary components. Also added a section to the documentation to explain how to use the "theme" config in the ps: whenever you have some free time, would you please review these two translations? The context of "start" and "stop" is start recording / stop recording. |
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.
Thanks @ntma
I tried it and it works well. The appearance of the application really benefits from this new scheming approach. See some (mostly cosmetic) remarks inline.
It would be great to have a small explanation in the docs how to create color schemes. Or where to generate them. |
Hi @ntma. First of all this is some awesome work and I'm happy to see you got going!
Thats it from me, sorry for the lengthy post. |
Hi @fschmenger , I'll try to make it short 👍
Yes we can do this. I wasn't sure at which level Wegue should control it's colors so I tried to set the control to the top level:
I am not sure if you are referring to the panel of the hamburger menu in the app-bar. If so, the answer to 4. may also answer this question.
Hmm, but the LocaleSwitcher functions as a drop-down menu while the others (e.g: Recorder) activate a feature. That's the logic that I was following. I was just trying to give an extra and of course we can revert this change at any time 👍
The Regarding the hamburger menu and knowing that:
then the panel should have a surface color as background with a secondary color for the buttons. There is a short insight about this topic in the Primary Colors, Secondary Colors and Surface Colors sections of this material design doc.
Sure thing, I will add this.
Interesting, I didn't know about the
Sure, I will do this. |
Hi @ntma, big thanks for your ongoing work on this. Looks very very promising 👍 I agree that if we introduce theming by vuetify everything should be handled by it. Concurrent approach by having some props set in the app-config outside of the theming config block would cause confusion. Also configuring should remain easy. So the already mentioned default mechanism is quite important. Users should be able to configure only a subset of theming props or even nothing. Otherwise users/admins and up in config hell, if the need to configure everything. |
Hi @ntma, thanks for the clarifications and links to the notable sources. Since we have a response from the PM, I think we're good to finalize the topics mentioned in 1) and 4) and control colors at a theme level only. As a summary
Regarding 2) I misread the code ;). I can see you are using the primary color for all the buttons on the app-bar now, which is what I expected. Otherwise I can see you're pretty much there! @chrismayer The remaining questions to the PM: |
Hello all, @chrismayer Glad that the PR is meeting the expectations! 👍 I will try my best to finish it as soon as possible, since I will be a bit busy for the next days.
Cheers. Feel free to ask if any future change raises some suspicion!
I will advance to this change then 👍
No problem! I was all over the code for this PR so some changes may not be that clear. |
@ntma I just scrolled over your changes. Could you elaborate on, why the primary color is mandatory for the light theme, and the secondary color for the dark theme? This asymetric approach is a little hard to understand, don't you think :) Otherwise good job implementing all the fallbacks. Will give it a test run soon. |
@fschmenger Indeed, thanks for noticing that! I had it in my notes but eventually forgot to commit that explanation. |
…u-maprecorder-win
… for v-select/v-combobox
thanks for @ntma and @fschmenger for the ongoing work. I did not follow all the recent details anymore. Let me know if you need an additional review. Otherwise I trust the approval of the others. |
Hi guys, I am back! So, to reply some of the pending questions/reviews from @fschmenger:
I think the problem will persist even if we change the dark theme tones, as the hovering shadow will conflict with the dark shades. I could ignore the issue for now but I feel that Vuetify (like many other UI frameworks) are in a lot of pressure to release their stable version for Vue3. Details like this are probably not their priority right now 😞 Should I still revert the changes?
Indeed, nice catch! One more caveat for Vuetify 👍 I will change it to your suggestion!
Regarding the solo fields, since we are not opting for the near perfect solution (and I totally agree with this decision), should this field take the same color as the header color?
I agree with the infoclick change. Having custom components converted to Vuetify components will simplify the material theming 👍 |
Hi @ntma,
I'd say yes. Sorry for bringing up the issue at all. But lately I had time to look into it and noticed that this is a general vuetify issue with dark themes. I think we have to live with hovering effects being lost for dark tones for now. IMO having a straightforward code should be prefered over a specific fix, that won't remove the problem at global scope.
Did you check the snippet I proposed. I couldn't see the drawback while it looked to me like we're retaining the accent colors. Or am I missing something? |
One last thing from my part, that I cannot see being finally adressed in the discussion above.
Again i can only point out, that for my personal taste I would opt for the simplest code-wise solution, and use the primary color for the hamburger menu (especially as it seems to me as this is not explicitly discouraged by the MD spec). I propose @chrismayer should make a clear ruling on this and then we go with whatever he has to say. |
Hi @fschmenger ,
It's totally fine. I understand that reaching a future proof solution isn't always easy 🙂 I'll revert the changes in the next commit.
I did. The main difference is the 3rd elevation added by the 3rd dark shade (docs about material elevation here). Here are two visuals (first with solo and second without), where the red numbers represent the three elevations. With solo:Without solo:Elevation is essential to differentiate components (specially in the dark mode). Lighter shades will simulate positive elevation while darker shades will simulate negative. In my point of view, solo fields should that a negative elevation (in respect to their parent components). Although they are components that should stand out, they are at the same time recipients for user input. And thus should look like an embedded field into it's parent component. Hence my effort on trying to make it look like that 😁 |
Hi @ntma, thanks for the screenshots regarding the solo fields - I can spot the difference now :) I'm a bit undecided whether this is a good feature for the following reasons:
Overall to me the feature looks too minor to justify a bunch of specific code. IMO, if we decide to keep this in, then for the sake of maintainance you should probably wrap up the wegue.css rules by a class and assign it to the respective controls. |
Hi @ntma, thanks for your ongoing work and your gigantic patience with the huge amount of remarks, discussions and suggestions by the reviewers. I really appreciate that you're still on this 👍 But to not overstretch you patience 😉 and to get this killer feature into the Wegue code base we should shorten this a bit up. Therefore I propose the following: We should go the simplest approach for open remarks/request to get them quickly done. For the hamburger menu we should use using primary color (simplest approach? Correct me if I am wrong). So @ntma would you please do a last round of providing final adaptions, if necessary? Would be very appreciated. Afterwards give us a ping that this is finalized. Again thank you all (especially @ntma and @fschmenger) for your huge work on this! |
Hi @chrismayer , Glad that you appreciate the effort done in this PR! 😁
I did the last round and:
As a last remark, this PR adds the ability of using the Vuetify color classes as CSS variables (docs here). I didn't test it but I believe these variables can be used to style the map features if required. And with that done, I conclude this work. Thank you all for the patience on reviewing this PR. If there is still something that I missed or requires changes, please let me know 👍 |
Hi @ntma, thanks for your ongoing effort. I can see 2 finalization tasks:
Otherwise this looks good to me! |
Hi @fschmenger,
Makes sense. Done!
Unfortunately yes. As far as I know, there is no simple way of overriding the text/border/input color in case the field is over a primary color. The CSS overrides are now wrapped into Cheers 👍 |
Hi @ntma, thank you for the prompt response and fixes.
I'm a little bit confused again, as I can't see the rule taking effect now - why the name of the css class as the associated components are now no longer EDIT: After reading over your comment again, I can see the effect for the app-conf-projected. Regard it as resolved :) |
@chrismayer I reviewed the code and ran some additional integration tests on my app with it's specific theme. I think this PR is as good as it can get, so feel free to merge. @ntma Thanks a lot for going through all the proposals and all the time and energy you invested into this. I'm looking forward to work with you on some topic again in the future! 👍 |
Anytime! If some issue arises from this PR in the future, I don't mind taking a look into it 👍 |
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.
Fantastic work.
I tried it again and I love it!
I also tried the built version produced by npm run build
and it seems to work well.
Ready to merge from my side!
THIS IS GREAT! 🚀 Thanks for your fantastic and tireless work @ntma. Very much appreciated. I hope you stay part of the Wegue community. Would be a great benefit for us all. Also big thanks to @fschmenger for managing this and for the endless reviews. And of course thanks to @JakobMiksch for your input. I am going to merge now. 🎉 |
Anytime! I'll try to contribute more whenever I find myself with some spare time 👍 |
This PR allows overriding the default Vuetify theme configuration.
Tasks:
baseColor
will be replaced bycolorTheme
;baseColor
);baseColor
;Extras:
allowVuetify theme presets (material studies).To improve in the future
Material design guidelines
Closes #202