-
Notifications
You must be signed in to change notification settings - Fork 69
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
Global: Implement Dark Mode 🌙 #669
Conversation
* Implement dark mode * Remove outdated overrides
* Seems like these overrides has no effect with the new version see https://squidfunk.github.io/mkdocs-material/upgrade/#changes-to-html-files_1
* update btn colors * remove duplicates
3b0e340
to
0fa0744
Compare
Thanks for that. When I run it here is what I get on the frontpage by default: ... where the dark mode toggle is missing. Let's have it there too. It's also missing on the Features page. Then when I click on the "Install" tab, it switches to dark mode automatically: And then when I click on the home logo to go back to the frontpage: ...it switches to dark mode. I suspect the frontpage starts with a value unset. The pages that have the dark mode toggle set that value, and so when visiting the frontpage after, the value is now set and the dark theme kicks in. My slightly quirky setup may be revealing that issue: Ubuntu 22.04 light mode + Firefox automatic mode + Mozilla dark theme addon enabled. (For comparison this didn't happen on Brave (Chromium based) browser on the same platform). Getting dark mode setting for front+feature page should provide a consistent experience. |
--color-black: #000000; | ||
--color-white: #ffffff; |
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 can just use white
and black
directly in places where these are used. If the idea is to abstract the references to have a single point of control, then a different name would be best e.g., --main-light
/ --main-dark
, or --white-like
/ --black-like
or smtg else ... (what concept is abstracted here is a bit hard to tell which I suspect was why just values were used before. Using values seems fine by me.)
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.
I've thought about it, but using --main-light
and --main-dark
suggests a relation to the main theme, which isn't the case here. The purpose, as you mentioned, is to have a single point of control for easy color management. Custom changes can still be made directly when needed.
Another point is that much of the extra.css
is redundant and can be minimized even more. I'd prefer to keep it as is for now, and in a future PR, we could remove more of the custom rules altogether.
As we discussed in the DMs, the reason the toggle is not showing is that the current inheritance doesn't support displaying the toggle and search input on the front page without routing in the docs. You can simply replace one line |
Update: I fixed it now, there is still the CSS color cut left to fix. |
* Remove frontpage_base.html override as we are extending from main * Still need to fix gradient color cut and style diffrence between dark and light mode
* Fix homepage gradients without the need to override base.html
Update:
|
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.
Awesome! So glad we got
- dark mode
- search on frontpage
- break from replacing base.html completely and therefore URL of assets problem fixed
Thanks for all the effort on this one!
❤️ Thank you for your contribution!
Description
This pull request includes the following changes:
These changes enhance the user experience by providing an alternative color scheme that is easier on the eyes in low-light environments.
Screenshots:
Checklist
Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:
Frontend
Reminder
By using GitHub, you have already agreed to the GitHub’s Terms of Service including that: