@sarajw
I imagine that if you do find a trick, it will be brittle and browser-dependent. I do hope you find a way! But I suspect hiding the body as you suggest is the only sure bet.
Conversation
Notices
-
Embed this notice
Paul Cantrell (inthehands@hachyderm.io)'s status on Monday, 07-Oct-2024 23:01:57 JST Paul Cantrell -
Embed this notice
Sara Joy :happy_pepper: (sarajw@front-end.social)'s status on Monday, 07-Oct-2024 23:01:58 JST Sara Joy :happy_pepper: Finding it difficult to avoid FOUC-ing up (Flash Of Unstyled Content) when switching out or adding in a linked stylesheet to the head via JS.
I thought normal JS scripts in the head would block render - and I suppose they do but then there's still a split second or more of no stylesheet while the switch is taking place and it rerenders.
Is there a way to make it less flashy without resorting to hacks like making html/body invisible until the last line of CSS is parsed?
-
Embed this notice