-
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
Allow (auto)switching front page between light mode and dark mode #37444
Comments
/assign |
Hi @sftim is anyone working on this feature? if not then I'd like to try adding this feature. |
I'm not working on it right now! if you want to work on it you can. |
/assign |
@sftim |
This issue is about changing https://kubernetes.io/ (and only that page) so for now let's skip adding an override button, and rely on detecting the user's preference. |
/triage accepted |
For now i'd like to /assign it to myself and wait for a go ahead to work on it. |
/assign |
You (and all other contributors) don't need anyone's permission to start work. |
Thanks @sftim ,
i am slightly confused by the statement. |
This is a limited scope issue to get familiar with using CSS to restyle the page, and to work out what we'll do with the images / icons.
Someone who wants to try this out will have to set their browser to dark mode or light mode explicitly (or wait until dawn / sunset). |
https://www.pcmag.com/how-to/how-to-enable-dark-mode-on-your-browser explains how to set dark mode |
Thanks @sftim , My first thought was that we want to add a button to help users choose which mode they prefer on the page.
I might have seen a reference to go through with this. will let you know if it work out right.. |
Hi @sftim I have written a shortcode for the <picture.. > it will look like this
where we mention the images to be used in the preferred mode. are we looking for a similar solution? |
I might call it |
It'd be great to see a preview of the effect, even if it's only a draft. |
Sure let me confirm first , we are to add this change in : https://github.com/kubernetes/website/blob/main/content/en/_index.html |
https://github.com/kubernetes/website/blob/main/content/en/_index.html is one of the places we might need to change I think the CSS (and its SCSS source code) is more important though. |
Please open a pull request to show the changes you're proposing. That's definitely the best way to collaborate here. |
Hi @sftim , I'll make a PR and update here then. |
/assign I am taking this, as i know how to implement this. I'll create a PR soon 🫡 |
@coder12git how's this work going? |
@sftim As mentioned here just to do this for only one page, but if i follow the other point, then when i am doing changes it's happening to all other pages, i.e not able to implement this only for one page. |
@coder12git |
let me do the try |
I recommend using CSS. CSS is awesome 😉 See https://css-tricks.com/a-complete-guide-to-dark-mode-on-the-web/ for details, including approaches that don't require any JavaScript. |
In CSS, we can use selectors to scope down our code to only apply to |
i will use awesome icons |
We discussed #45535 in today's SIG meeting. |
xref #25061 (comment) Just cross-posting here for reference. The current progress on this issue is positive and looks great. |
Hi fellows, |
No ETA I'm afraid. Most of the work on this website is done by volunteers. |
Did @coder12git take this on? |
The PR we have (which is ready for review) is by @tamilselvan1102 |
See #49586 for the latest PR (reviewable) |
This is a Feature Request
What would you like to be added
A cut down form of #25061
Allow (auto)switching front page between light mode and dark mode
Why is this needed
Change https://kubernetes.io/ (and only that page) to support detecting the viewer's preference for either light mode or dark mode, and then honoring it.
This should use a similar technique to https://opensource.com/article/21/10/dark-themes-websites and must also play well with our custom Docsy theme.
For images, we might need a custom shortcode that renders to something like:
Implementing that shortcode or layout would be part of the work for this issue.
Comments
This is a minimum-viable-product approach. It's much easier to make the change work for just one page, and then iterate.
Future work might also allow a mechanism to let the user specify a preference for dark or light mode that is different from what their user agent (web browser) is asserting.
After covering https://kubernetes.io/ we could look at whether there are other pages on the site where we're happy to widen the automatic switching to. For example, https://kubernetes.io/community/
Alternatively, we might work on https://kubernetes.dev/ (full site) and then come back to https://kubernetes.io/ once we've learned how to get a site working with 2 color schemes.
/area web-development
/kind feature
The text was updated successfully, but these errors were encountered: