6 ms·
Is there still no way to prevent the flash bang while waiting for initial content from the server?
by zamalek 6mo ago
Is there still no way to prevent the flash bang while waiting for initial content from the server?
- pocksuppet 6mo agoDecrease screen brightness. Turn off dark mode. No flashbang. Bonus: Battery lasts longer.
- silverwind 6mo agoUse `background-color` in Firefox's `userContent.css`.
- zamalek 6mo agoI love the idea of ending it for myself, but my users are still screwed?
- akersten 6mo agohow your users' browsers choose to render `about:blank` while waiting on your page to be delivered is outside of both your control and concern on Gnome i've got system-wide dark mode turned on and idk, my Firefox is dark gray until it gets any content. so users have the power and should exercise it to tailor their experience as they wish
- jagged-chisel 6mo agoI don't know if I misunderstand the problem, but what about a style tag at the earliest part of the page indicating the background color to use?
- zamalek 6mo agoThat flashbang happens during the initial latency (DNS, RTT, any server slowness).
- MitPitt 6mo agomake dark mode the default, then it's a flash of dark in either case
- NSPG911 6mo agosend a blank black page then load from there?
- ethan_smith 6mo agoA small blocking `<script>` in the `<head>` that reads the saved preference from localStorage and sets a class on `<html>` before any rendering happens is the standard approach. You can also set `<meta name="color-scheme" content="dark light">` which tells the browser to use the OS preference for the initial paint, covering the default case without any JS at all.
- Izkata 6mo agoThat's still after the server's response arrives, they're talking about the blank browser page before anything comes back in the response.
- skoskie 6mo agoCame here for this. I hate it too. When I make a site with dark mode, I make sure the dark color loads by default and then changes to light if needed to address this specific issue.