-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Take system's theme for the beta site #4022
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
Conversation
This won't work for the initial render. It will flash. |
Shall I add an IIFE to the document then? Like you had done in over reacted site? https://github.com/gaearon/overreacted.io/blob/master/src/html.js#L21 |
Seems like this doesn’t work for sandboxes? |
Do you mean for the sandpack component in the site? 🤔 |
Oh I see. That's in #4019. We need to figure out what to get in first. |
When I load a preview on this branch with initial Dark more, I see the toggle flash. |
What's happening here is that the SSR content always assumes the theme is light. You should either hide the toggle or show the correct toggle icon with CSS. |
Will work on it and push changes for toggle. |
I think I'll take it over from here. Thanks! |
1e31ba8
to
afc7965
Compare
thanks! |
If the user has dark theme as preferred color scheme. apply dark mode.
It was a todo in the code 😄
// TODO: respect system pref