inveniosoftware / docs-invenio-rdm

InvenioRDM docs
https://inveniordm.docs.cern.ch/
MIT License
21 stars 60 forks source link

Global: Implement Dark Mode 🌙 #669

Closed Samk13 closed 1 week ago

Samk13 commented 2 weeks ago

:heart: 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:

image

127 0 0 1_8000_ (2)

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:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.
fenekku commented 2 weeks ago

Thanks for that.

When I run it here is what I get on the frontpage by default:

frontpage_default_light

... 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:

install_default_dark

And then when I click on the home logo to go back to the frontpage:

frontpage_default_dark

...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.

Samk13 commented 2 weeks ago

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.

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 {% extends "main.html" %} here, but then we need to refactor these pages and rewrite the CSS again.

Samk13 commented 2 weeks ago

Update: I fixed it now, there is still the CSS color cut left to fix.

Samk13 commented 2 weeks ago

Update:

Screenshot from 2024-06-22 04-45-37

Screenshot from 2024-06-22 04-28-00

fenekku commented 1 week ago

Final look:

image