-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FOUC in SPA on (re)load. #13307
Comments
Upon further investigation, PicoCSS is not needed to reproduce. However PicoCSS causes the FOUC to be much more noticeable.
|
Closing this as I can't seem to reproduce the issue on Chrome desktop or Safari mobile. |
@eltigerchino: Is there anything I can do to help you reproduce the bug? Here is a short video of the FOUC in Chrome desktop: https://github.com/user-attachments/assets/01da66d2-fe89-45f7-89e8-4876ebc80659
Here is a short video of the FOUC in Safari: https://github.com/user-attachments/assets/9f320682-94be-45d1-9618-ddfbdde75add
|
I have confirmed inlining the styles into the app.html page template fixes the FOUC.
So it would be nice to have a way to inline global CSS (and SASS) into app.html.
|
Describe the bug
There is a jarring style transition if:
Reproduction
System Info
Severity
annoyance
Additional Information
I started investigating this due to FOUC of white background when (system-prefers) dark mode.
Related issue: Global styles or scripts #3127 (comment)
I simplified this issue to the absolute minimal reproduction, but it might be worth looking at the original issue I wrote involving PicoCSS:
Original issue with more details, including how to consistently reproduce on desktop.
Describe the bug
There is a jarring style transition if:
The CSS file loads PicoCSS.Reproduction
Plain CSS without PicoCSS:
With PicoCSS:
Although visible on desktop, the FOUC is most visible on mobile (iOS Safari).
pnpm preview
).To make FOUC easier to see on desktop adjust dev tools (and ensure serving from
pnpm preview
):Additional Information
If PicoCSS is moved from app.css to app.html the FOUC
stops occurringis much more subtle and less pronounced:While this seems like a work-around, it makes it difficult to configure PicoSS via SASS. edit: no longer complete work-around.If PicoCSS is loaded in both app.css and app.html there is a limited FOUC:
If PicoCSS is not loaded at all,
there does not seem to be a FOUC.the FOUC is only noticeable on mobile.This FOUC seems more pronounced on mobile (iOS Safari), even without network throttling. Usually quite visible on each page reload.
The text was updated successfully, but these errors were encountered: