Skip to content

Conversation

@VeckoTheGecko
Copy link
Contributor

This PR adds website support for Dark mode via a toggle in the top right.

Set as draft for visibility and to see if this is something we want to go forward with. Still need to fix contrast on the fonts and the images. For images that would require providing a dark mode compatible image (using the new ColorModeImage component) or otherwise changing the representation within the website.

Fixes #115

@VeckoTheGecko VeckoTheGecko changed the title Add dark mode support for website Add dark mode support Apr 1, 2025
@erikvansebille
Copy link
Member

Thanks for exploring! How would the ColorModeImage() then work in practice? There is already a dianegative UU logo in /public/funders-logos/UUlogo_dia.png; how would we code that that one gets chosen?

@VeckoTheGecko
Copy link
Contributor Author

How would the ColorModeImage() then work in practice?

import { ColorModeImage } from './components/ColorModeImage'

...
    <ColorModeImage
      lightSrc="/funders-logos/UUlogo.png" // image to show in light mode
      darkSrc="/funders-logos/UUlogo_dia.png" // image to show in dark mode
      alt="Company Logo"
      width="200px" // any other attributes you'd normally put on <Image/>
      height="auto"
    />
...

Then the image being shown would change accordingly

Copy link
Member

@erikvansebille erikvansebille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm done updating all the images to a dark-version too. The homepage animation could be slightly cleaner (without the small white border around it), but I'll do that later. What do you think? Shall we merge this, @VeckoTheGecko?

@VeckoTheGecko
Copy link
Contributor Author

VeckoTheGecko commented Apr 2, 2025

I think this looks great! Only comments are that we have some low contrast of the "days since" text (now fixed in 67d2bb5), and also we should be mindful that in blog posts we won't be as flexible with providing assets for both light and dark mode.

Happy to go ahead, feel free to merge :)

@erikvansebille erikvansebille merged commit 1e3b6aa into main Apr 3, 2025
3 checks passed
@erikvansebille erikvansebille deleted the color-mode branch April 3, 2025 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dark theme on new website?

3 participants