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
Minimal 'dspace' theme #1063
Minimal 'dspace' theme #1063
Conversation
This pull request introduces 5 alerts when merging f7e45e4 into 1115c58 - view on LGTM.com new alerts:
|
f7e45e4
to
4035739
Compare
@artlowel : Just a quick note here...this work will need to be integrated with #1057 as well (as this PR should depend also on that PR). But, that might be more easily done once #1042 is merged. In any case, it's great to see an early version of this PR. Just wanted to be clear that in terms of priority, I feel both #1042 and #1057 should be merged first, followed by this one. |
This pull request introduces 1 alert when merging 4035739 into 1115c58 - view on LGTM.com new alerts:
|
Note that the one unused import LGTM is warning about was left in on purpose. Because the base theme is commented out, the import isn't used. But it would be needed if you were to uncomment it again, that's why I chose to leave it in. |
4035739
to
d924c0f
Compare
This pull request introduces 1 alert when merging d924c0f into 1115c58 - view on LGTM.com new alerts:
|
f860d48
to
be1d78a
Compare
This pull request introduces 1 alert when merging be1d78a into 66463cf - view on LGTM.com new alerts:
|
@artlowel ; I tried this out today just to see if custom themes are working for me...this one also is unfortunately not working entirely as expected (see screenshot below). A few immediate issues I hit include:
Here's a screenshot of the homepage I see: Again, as usual, I'm doing a I also just tried one of the more "obvious" Windows-specific issues... I changed the line endings of all the files in the |
hi, @artlowel @tdonohue I take the freedom to update the PR title to reflect the fact that this is about a sample, additional minimal theme added just to demonstrate the ability to use multiple theme and provide some examples to mention in the documentation. Nothing in such theme should constitute improvement in the UX, look & feel, accessibility or other aspects that should be instead applied to our "default" (i.e. in #1057 ) |
@tdonohue I finally got a chance to set up a dev environment on my home windows PC, and I could reproduce your issues. I think I fixed them. The cause turned out to be path separators, as usual. Could you test it again? |
This pull request introduces 1 alert when merging 4579245 into a5bc6c1 - view on LGTM.com new alerts:
|
@artlowel : I can verify that your path separators fix has fixed all my issues with getting the (Just as a sidenote, while my tests are all successful with this PR, I'm refraining from a full review until #1057 is finalized & this PR can be rebased on top of the code changes in #1057. However, generally speaking, it looks good at a glance. But, we will need to look closer at any HTML changes in this |
4579245
to
f9143ac
Compare
This pull request introduces 1 alert when merging f9143ac into d7daaf4 - view on LGTM.com new alerts:
|
f9143ac
to
fb634cd
Compare
This pull request introduces 1 alert when merging fb634cd into 0f7a32d - view on LGTM.com new alerts:
|
fb634cd
to
cbee776
Compare
This pull request introduces 1 alert when merging cbee776 into 0f7a32d - view on LGTM.com new alerts:
|
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.
@artlowel : Gave this a quick try, overall, this looks great. I have a few very minor suggestions, but I'll go ahead and approve it 👍 .
Most of my suggestions are trying to improve color contrast for accessibility. Though, I'm not sure all the issues are in this 'dspace' theme itself, so we could choose to clean these up in a follow-up PR quickly. I also linked to the Chrome plugin/tool I was using to analyze the homepage.
$gray-800: #444444 !default; // #444 | ||
|
||
$navbar-dark-color: #FFFFFF; | ||
|
||
/* Reassign color vars to semantic color scheme */ | ||
$blue: #43515f !default; | ||
//$green: #92C642 !default; | ||
$green: #92C642 !default; | ||
$cyan: #2e80a3 !default; |
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.
We're going to have to make $cyan slightly darker...I'm getting an insufficient color contrast issues with this color on a white background when using the axe DevTools tool in Chrome. Maybe change this to something like #207698
(which, to my eyes looks similar but darker).
Similarly, I think we'll need to update the .text-muted
style (used in descriptions of communities on homepage, etc) to be something like #767676
in order to solve color contrast issues there too (although this style might be in the base theme instead of the 'dspace' one).
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.
We're going to have to make $cyan slightly darker
Done. I used your suggested color
Similarly, I think we'll need to update the .text-muted style (used in descriptions of communities on homepage, etc) to be something like #767676
That would make text-muted
indistinguishable from text-secondary
, so then logical thing to do might be to use text-secondary
everywhere we use text-muted
now? But that would have to be a separate PR, updating the base theme.
For now, I've changed $gray-600
(which is what text-muted
uses) to be halfway in between its old value and $gray-700
(which is text-secondary
). Perhaps that's enough?
src/themes/dspace/app/+home-page/home-news/home-news.component.html
Outdated
Show resolved
Hide resolved
This pull request introduces 1 alert when merging 7cbce55 into 9586428 - view on LGTM.com new alerts:
|
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 @artlowel for this PR
it looks quite good, I've a couple of feedback:
- the chosen font seems to render the characters too thiny, and in my opinion it creates contrast issue on a white background. this is most notable with the links
The default one seems to be clearer and more functional in my opinion - the background image used in the home-page creates contrast issues too, because the text results difficult to read in some points of the image. If it's not strictly necessary I would remove it
@@ -7,7 +7,7 @@ | |||
<title>DSpace</title> | |||
<meta name="viewport" content="width=device-width,minimum-scale=1"> | |||
<link rel="icon" type="image/x-icon" href="assets/images/favicon.ico" /> | |||
<link class="theme-css" rel="stylesheet" href="/base-theme.css"> | |||
<link class="theme-css" rel="stylesheet" href="/dspace-theme.css"> |
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.
why this has been replaced with the themed css? Should the theme applied override the base-theme.css automatically?
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.
It should, feel free to put it back and verify that it will update automatically. But it's an efficiency thing.
If you put the css needed for the initial page load there in the first place, it prevents people from having to download the wrong css first, before app.component can replace it.
It is something I would recommend everybody does after they've decided on the theme they want.
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.
it makes sense, maybe for the 7.1 we can think to improve it by selecting the css according to the chosen theme. It could be made with webpack, here an article that could help https://medium.com/dailyjs/inserting-variables-into-html-and-javascript-with-webpack-80f33625edc6
…o improve readability
Thanks for the review @atarix83 Both the font and the background image were put there to give an example of how dspace could be themed in ways that a lot of institutions might want to, as well as to give dspace a somewhat nicer look out of the box. If we simply keep the base font, we don't give an example of how to change the font. But you're right, it was very thin. I've replaced it now with a similar but slightly thicker font. For the same reasons I want to retain the background image. So I made the dark overlay on the background image slightly darker to make the contrast with the text bigger |
This pull request introduces 1 alert when merging 9bf2465 into 3d51110 - view on LGTM.com new alerts:
|
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 @artlowel it looks better now
@@ -7,7 +7,7 @@ | |||
<title>DSpace</title> | |||
<meta name="viewport" content="width=device-width,minimum-scale=1"> | |||
<link rel="icon" type="image/x-icon" href="assets/images/favicon.ico" /> | |||
<link class="theme-css" rel="stylesheet" href="/base-theme.css"> | |||
<link class="theme-css" rel="stylesheet" href="/dspace-theme.css"> |
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.
it makes sense, maybe for the 7.1 we can think to improve it by selecting the css according to the chosen theme. It could be made with webpack, here an article that could help https://medium.com/dailyjs/inserting-variables-into-html-and-javascript-with-webpack-80f33625edc6
You're right. I considered that when working on #1035, but it wasn't trivial as it would require us to determine which theme is active for the home page, outside of angular (in the webpack config). As I was short on time I left it out back then. But it would definitely be an improvement. |
The main reason for the that css being hardcoded in the HTML in the first place, is so you don't get a flash of unstyled content while the app is loading for the first time. Perhaps a better way of solving that problem would be to create a small dedicated CSS file that only styles the initial loading component (and perhaps a few other things that might be visible in the first fraction of a second), that can't be themed based on the route, but is the same all the time As soon as the app bootstraps, the theme css can take over. |
Merging as this is now at +2. I'll create a follow-up ticket regarding selecting the CSS automatically based on the chosen theme. |
References
Depends on Make all non-admin page-level components themeable #1042Description
This PR adds a simple default theme to dspace, based on the mantis theme we had for the preview release.
Instructions for Reviewers
This PR removes the mantis theme folder, and adds a new "dspace" theme.
All changes are done using css apart from two exceptions:
I fixed a small issue we've had for a long time in root.component.ts (so outside of the themes folder): while the app is loading the next route, the loading component appeared above the contents of the old route. My change hides the contents of the old route while loading.→ was already fixed by #728 accessibility theming #1057To test this, simply build it and make sure you're not overriding the themes array in your environment files. It should show up by default as I've made it the default theme.
This PR seems bigger than it is, because it depends on #1042 You can see only the changes in this PR hereChecklist
yarn run lint
package.json
), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.