3 ms·
> block the entire page, really? talk about burning down the village to save it I'm curious for what the other approach is. Users find it annoying to refresh t
by nickelpro 3y ago
> block the entire page, really? talk about burning down the village to save it
I'm curious for what the other approach is. Users find it annoying to refresh the page and have their dark-mode setting change, or have their dark-mode setting change while navigating the site.
So I have to block paint until I can query local storage in order to avoid flashing, what's the alternative? Below someone suggested using cookies and only serving CSS that does the desired styling, which I guess is doable but requires a non-trivial infrastructural change.
- hw 3y agoAs long as you have a good reason for your decision. Some things you just have to make tradeoffs and can’t please everyone. Enter key to submit or enter key for newline in a chat context? You’ll go crazy trying to solve for all - sometimes it is just not possible
- gwern 3y agoYou don't need to hide the entire page until fully rendered. You inline in the head just the bits of CSS/JS you need and set styles from there, so if you are in dark mode, it's set to dark before anything has rendered, without needing to block a huge amount of time. You can see how it works on my site https://gwern.net/ https://gwern.net/ - set dark mode in the toggle (assuming it is not your system setting already), and refresh or force-refresh; note that there is no flash of white nor is the page hidden until rendering is fully finished.
- tubs 3y agoOn mobile safari the little Control Strip at the bottom doesn’t appear after the first couple of refreshes. I can see it try to slide up then it dies.
- gwern 3y agoThe idea there is what we call 'demo-mode', a new feature to try to enable helpful chatty features but for only _n_ page loads. So the full theme toggle (or Control Strip in Mac terms) is exposed on the first page load, but then is left collapsed into the gear on subsequent page loads to reduce clutter. I don't think it should 'try to slide up then it dies'; do you mean you can't see the gear at all?