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

add HTML meta tag for automatic light/dark mode #8

Closed
wants to merge 1 commit into from
Closed

add HTML meta tag for automatic light/dark mode #8

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 10, 2023

No description provided.

@dgw
Copy link
Member

dgw commented Nov 10, 2023

While I haven't directly tested this, the tag seems to function as intended on other pages I've seen using it. It's a very simple way of respecting the user's system-level theme preference without resorting to CSS nonsense, and is fairly well supported in major browsers now. https://caniuse.com/mdn-html_elements_meta_name_color-scheme

@ghost
Copy link
Author

ghost commented Nov 10, 2023

Works great. :) The look will vary by browser since they all use their own color schemes, but here's Firefox on macOS:

Screen.Recording.2023-11-10.at.3.59.37.PM.mov

Edit: and toggling light/dark modes:

Screen.Recording.2023-11-10.at.4.02.12.PM.mov

Edit 2: and another one toggling the preference within Firefox itself, rather than system-wide:

Screen.Recording.2023-11-10.at.4.05.08.PM.mov

@dgw
Copy link
Member

dgw commented Nov 10, 2023

Yep, good demos.

Decent CSS to pretty up the list a bit will be someone else's problem. 😝

@ghost
Copy link
Author

ghost commented Nov 10, 2023

Decent CSS to pretty up the list [...]

Bare minimum: needs to be a React project with 4GB of imports.

@Exirel
Copy link
Collaborator

Exirel commented Nov 11, 2023

I wanted to reword the commit and I think I more or less messed-up...

... but the change is in master now! So consider this PR merged. Not closed. I swear.

@Exirel Exirel closed this Nov 11, 2023
@ghost ghost deleted the patch-1 branch November 11, 2023 16:52
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