Avoiding Dark Mode flicker #2464
-
Hey, wondering if you have thoughts on the initial rendering of the page for users who have a system setting for 'prefers-dark-mode'? It looks like the implementation on the paste docs site currently renders in light mode for SSR and then switches to dark mode in the client once the page hydrates. This leaves a visible light mode flicker during the page load, which I would love to avoid. Is there a way to have both the light and dark modes in SSR and use CSS to choose which to apply, so that we don't need to delay that decision to when the JS runs? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hey @hughrawlinson - I've shared this question with the team to discuss, and we'll get back to you soon! |
Beta Was this translation helpful? Give feedback.
-
Hey @hughrawlinson - chatted about this with the team, and we know how to fix it, so we've added a ticket to our backlog. Can you share a little bit more detail about what product/feature this is for and what timeline you're working with, to help us prioritize this fix? |
Beta Was this translation helpful? Give feedback.
-
Marking this as answered as a duplicate resolution with #4245 |
Beta Was this translation helpful? Give feedback.
Marking this as answered as a duplicate resolution with #4245