Skip to content
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

Added dark mode functionality #124

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

amit-077
Copy link

Added a toggle button on left top corner, so user can switch between dark and light modes.

@lgarron
Copy link
Collaborator

lgarron commented Oct 18, 2024

I appreciate the instinct to contribute, but I'm concerned that:

  • This reformats way more than necessary, making it unclear how much actually changed (and affecting future diffs).
  • The implementation isn't really appropriate for 2024. If we're going to do dark more, I think it should use prefers-color-scheme and color-scheme features of CSS.
  • We have more than one page now.

@amit-077
Copy link
Author

Are you seeking to implement a theme that automatically adjusts to the user's system preferences for light or dark mode, without the need for a manual toggle button?

@lgarron
Copy link
Collaborator

lgarron commented Oct 20, 2024

Are you seeking to implement a theme that automatically adjusts to the user's system preferences for light or dark mode, without the need for a manual toggle button?

I'm not particularly convinced dark mode is the right choice for this site, as that would vary the visual cues it presents in testing and screenshots.

But yeah, if it's going to have dark mode I think it should use modern conventions and match the OS. If there's an override, it should be an optional override config in e.g. localStorage that is used to set an attribute on the body to set the color scheme using CSS cascading.

@amit-077
Copy link
Author

I have added dark mode support with OS preference detection and optional localStorage override. Please review it.

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.

2 participants