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
While this seems like a work-around, it makes it difficult to configure PicoSS via SASS. edit: no longer complete work-around.
It is much more difficult to see on desktop, but is clearly evident when reloading on mobile (iOS Safari.) Only the h1 color flashes to red. (I also witnessed this once on desktop.)
If PicoCSS is loaded in both app.css and app.html there is a limited FOUC:
Only the h1 color (set in app.css) flashes black to red.
The PicoCSS-related styles are already set and do not flash.
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:
Leftium
changed the title
FOUC in SPA (when PicoCSS is @imported).
FOUC in SPA on (re)load.
Jan 14, 2025
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: