You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With dark mode enabled, the default styles still get applied for a few frames while the page is loading, which results in a quite jarring flash. With the devtools open I can see that the <html> tag initially gets added to the DOM with no data-theme property, then gets set to data-theme="light", and only after does it receive the actual data-theme="dark" value.
There are three approaches that I can think about right now:
Loading the saved theme value early enough for it to be available by the time the first frame is rendered
Render a gray background until the required information becomes available (this seems like an unnecessary compromise, but would still be better than the current behavior in case you are against implementing either of the two suggestions from above)
Personally I would probably go for the second option, if you'd also be happy with that, I'll send a PR.
P.S. Is it just me, or are code blocks barely visible in the current dark theme? Since everything is already monospace, the font doesn't help in distinguishing them, and their background is so subtle, that I can only see them if I know exactly where to look.
The text was updated successfully, but these errors were encountered:
With dark mode enabled, the default styles still get applied for a few frames while the page is loading, which results in a quite jarring flash. With the devtools open I can see that the
<html>
tag initially gets added to the DOM with nodata-theme
property, then gets set todata-theme="light"
, and only after does it receive the actualdata-theme="dark"
value.There are three approaches that I can think about right now:
prefers-color-scheme
value provided by the browser (implementing Switch to dark/light mode based on OS setting #481 would probably solve this as well)Personally I would probably go for the second option, if you'd also be happy with that, I'll send a PR.
P.S. Is it just me, or are
code blocks
barely visible in the current dark theme? Since everything is already monospace, the font doesn't help in distinguishing them, and their background is so subtle, that I can only see them if I know exactly where to look.The text was updated successfully, but these errors were encountered: