-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Home page enable dark mode #45535
Home page enable dark mode #45535
Conversation
✅ Pull request preview available for checkingBuilt without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
/assign @sftim |
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. This is pretty close.
I don't think we should merge this as-is, because one of the case studies' logos almost disappears. There's a similar problem with the CNCF logo and the Babylon logo (which is missing some transparency. This PR should fix those issues as part of the required changes, without breaking other pages or breaking the light mode view.
If you'd like to also switch the colors for the top navigation bar (when no banner is showing), I think that would help - but I don't think we should insist on it.
Finally, please add a comment to the top of assets/scss/_base.scss
and assets/scss/_custom.scss
so that people know about the partial dark mode support.
/area web-development |
@tamilselvan1102, which of these are you comfortable picking up?
The work here is a prototype for a wider piece of work, so if there are problems we'll eventually want to fix, it's best to plan fixes rather than find a one-off work around. |
@sftim
|
@sftim |
assets/scss/_base.scss
Outdated
.cid-home main section:is(#talkToUs) img { | ||
filter: invert(100%); | ||
-webkit-filter: invert(100%); | ||
} | ||
|
||
.cid-home main section:is(#cncf) { | ||
background-color: $dark-bg-color-2; | ||
background-image: url(/images/cncf-white.png); |
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.
Inverting image colors or adjusting background image according to prefers-color-scheme: dark
is nice addition for the homepage. However, extending this functionality to the entire docs and all its different images would be a challenge. It would be nice if this could be achieved through a Hugo shortcode, dynamically altering image source based on prefers-color-scheme: dark or light. I notice the issue description(here) also hints at employing shortcode for image switching, which aligns well with this suggestion.
For guidance on shortcode, refer to the tips provided at https://gohugo.io/templates/shortcode-templates/
Thank you @dipesh-rawat |
For some tips, check out https://cassidyjames.com/blog/prefers-color-scheme-svg-light-dark/ Because the main page is HTML, if we want to skip a shortcode and write HTML directly, I am also fine with that too. <picture id="icon-briefcase">
<source srcset="briefcase-dark.svg" media="(prefers-color-scheme: dark)">
<img src="briefcase-light.svg">
</picture> You can / we can use a similar technique inside partials (see |
@tamilselvan1102, how are you doing on this? Remember that this is a prototype to show how we'll do the rest of the site; it's less important to find shortcuts that make one page look right, than it is to explore the kind of changes we'll need so we don't have to take shortcuts. However, you don't have to consider the whole site. The ask is to do just that one page, but to do it without those shortcuts. |
@sftim |
@dipesh-rawat @sftim |
(Please) don't switch colors for vendors' logos. We wouldn't be allowed to do that. |
@sftim |
This is work for a contributor working on this issue; you could look for those yourself @tamilselvan1102. |
@tamilselvan1102 we've a very limited pool of volunteers willing to help with UI design, but I do think that feedback about the solid black is relevant. Could you use a very dark gray instead for the page body? |
If you'd like someone to take over this work and build on what you've done, that's an option too. You've put in a huge amount of work already; what's at tension here is:
|
In either light or dark mode, I can't see an AppDirect logo on https://deploy-preview-45535--kubernetes-io-main-staging.netlify.app/case-studies/ I see a similar problem with NetEase. Otherwise, I think this is looking good. |
@sftim |
@111andre111 |
Oh, sorry. Missed that fact. However the scrolling down issue would not count into that as well that I described in the first part of my comment? |
Please clarify the problem @111andre111 (why should we consider that behavior defective)? |
Sure, I can repeat it again.
|
Thanks for the screenshots @111andre111. But, why is this behavior unwanted / something that means we can't merge this initial PR? |
I just tried to understand if this is the intended behaviour that this PR should aim for. If so then looks good to me. |
This PR wants to be an MVP, so the menu bar lightening on scroll is fine (by me). Pending feedback though: #45535 (comment) |
@tamilselvan1102 if you write a PR description, that will make it easier for people to review constructively. |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
#45535 (comment) |
@tamilselvan1102 : Please could you rebase since there appears to be a merge conflict? |
I sense contributor fatigue, or at least the possibility of fatigue. If we can pick up the work @tamilselvan1102 has done, move it forward, and get it merged, I think that will help a lot. |
Sorry about the wait on this one @tamilselvan1102 |
@milinddethe15 to follow up on this. |
/close (in favor of PR #49586) |
@sftim: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Fixes: #37444
This is to enabling dark mode only for https://kubernetes.io/ page.
ℹ️ Superseded - see #49586