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
GFX: Theming tweaks #1590
GFX: Theming tweaks #1590
Conversation
@AllienWorks Looks like travis ran into an issue with the tests... testing locally results in the same error. While we can increase the amount of memory node uses to run with during the tests, which should help solving the problem, I'm not particularly keen on doing that unnecessarily. To that end, I've traced the issue to the inclusion of both light and dark themes, specifically, adding both the following imports into
Notably, just including one or the other starts the tests runner at least. Seems there is a problem with including angular-material-theme more than once? Anyways, looking at the make-up of its inclusion, the same data/inputs/construct are used in both theme files. Would it not be simpler for the sake of theme creation (and to possibly solve this issue), to take the whole of:
out of each theme file and import it once (possibly via a separate scss file??) in _config.scss after the theme files have been imported? Replacing the variables $dark-theme and $light-theme with just something like $theme. I'm not sure if its possible, so just checking... |
This is a correct way of adding multiple themes which can be switched dynamically. Honestly I'm not quite sure what might be the problem there. Basically you define the This will however only swap the main colors. As I was experimenting with dark theme, it become apparent that we'll need to do more than that, ie. redefine even the foreground and background colors for the components - that's what
It's way more complicated than I anticipated, as we'd need to redefine all colors in all components based on theme used. That would mean a lot of new code for each new theme used. In my naivity, I thought one small file with defined colors for each theme would be enough, but it's not the case. The dark theme isn't even super nice at the moment - even half-finished.. You can check it with replacing the class in
So yes, I'm having second thoughts about this. All new code will need to be styled two times (color-wise) for 2 themes. If more themes are created, it will get even worse. At this point I'm thinking "let's stick to one default theme only". If you guys agree, I will remove the dark theme code from this PR. However this PR has even more changes which I'd like to see merged. |
Fair enough... you're the expert on these things which is why I was asking. :D I got the whole material theme setup (actually did some looking into how the themes were generated, so I felt a little more educated :b). From I could determine, most places were The way I would have seen this working is (which is subject to my own experiences so may be a little shortsighted or "not quite right", so take it for what it is):
Granted, I haven't tried that with Material themes before, so oh well :D Anyways... If you're happy to keep a single theme for now then I am as well. And if there are other changes that you want included here, then perhaps removing one of themes for now is better, just to get those changes in. |
OK, dark theme removed + some small tweaks added. Ready to merge @zaSmilingIdiot |
No much has changed visually, but this PR brings updates & tweaks to how our themes are handled (now properly, Material-way).
This will also help with dynamic themes in the future, which I wanted to keep away as a surprise, but you'd find out anyway, so.. :)