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
When loading the fallback page, a blank white page is shown until the JS loads my stylesheet. This is very annoying if I am using a dark background-color, because the page flashes from the blank white page to my dark background color.
Because the stylesheet is imported in my root +layout.svelte, I expect SvelteKit to include it in the head element, but it doesn't.
This happens because without server-side rendering, SvelteKit cannot render the stylesheet import from the layout.svelte file. Therefore, the stylesheet import only occurs after the browser has parsed the JavaScript for client-side rendering (CSR).
To workaround this, you can introduce the stylesheet earlier by linking the /static/style.css file in src/app.html before CSR occurs, avoiding the white flash.
Describe the bug
When loading the fallback page, a blank white page is shown until the JS loads my stylesheet. This is very annoying if I am using a dark
background-color
, because the page flashes from the blank white page to my dark background color.Because the stylesheet is imported in my root
+layout.svelte
, I expect SvelteKit to include it in the head element, but it doesn't.Related: #1948
Reproduction
https://github.com/GitRowin/svelte-kit-fallback-flash
Logs
No response
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: