Turbo: Reduce or eliminate FOUC due to stylesheet being merged in and removed

Created on 19 November 2024, 4 months ago

Problem/Motivation

Flash of unstyled content occurs some of the time, especially when the server is a bit too slow to respond, and is even worse with CSS aggregation enabled when removing unused stylesheets only to add the new aggregates that contain a lot of the same styles.

See https://github.com/hotwired/turbo/issues/1131

Steps to reproduce

See above.

Proposed resolution

We've patched Turbo to delay removing stylesheets if rendering is paused (e.g. for a page transition), but this is left up to the theme to do; perhaps this is an argument for adding a transition and delay by default and allowing themes or other modules to opt out if desired?

Remaining tasks

TBD.

User interface changes

No more FOUC.

API changes

None?

Data model changes

None.

🐛 Bug report
Status

Active

Version

2.0

Component

User interface

Created by

🇨🇦Canada ambient.impact Toronto

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024