[wp-trac] [WordPress Trac] #53494: Styles not applied to block using theme.json with seperate assets loading enabled

WordPress Trac noreply at wordpress.org
Wed Jun 30 12:50:52 UTC 2021


#53494: Styles not applied to block using theme.json with seperate assets loading
enabled
--------------------------+-----------------------
 Reporter:  walbo         |       Owner:  (none)
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  5.8
Component:  Editor        |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------

Comment (by aristath):

 Replying to [comment:22 walbo]:
 > Have tested PR1447 and it does solve the issue ✅.
 >
 > However I'm not a big fan of adding all the styles to the footer. Users
 may experience a small "flicker" of the content before the style is added.
 With this approach `should_load_separate_core_block_assets` does feel a
 bit experimental. Ideally it would be in the `<head>`, but I think that is
 a bigger job and don't think that is realistic before 5.8 is launched.

 Well... loading styles in the footer is not the default. Block themes and
 block templates load these styles in the `<head>`. For classic themes this
 is opt-in, so users would have to specifically say "I want this". With
 that in mind, it's not something that will break someone's site or degrade
 their experience. It's a choice, and like every choice users make, this
 too will have its pros and cons.

 As a sidenote, these styles get added inline so the browser doesn't need
 to make an additional request to get global styles. This makes the FOUC
 just a few milliseconds since the browser only has to parse the main HTML
 of the document and these styles are immediately available. In all my
 tests I was never able to visually perceive a significant difference -
 unless I throttle my browser to 3G speeds or below.
 My 2c: If it takes more than a couple milliseconds then it's safe to
 assume we're dealing with a slow connection, in which case the FOUC is to
 many a welcomed side-effect that allows them to start consuming their
 content faster. Or at least it was for me when a 3G connection was all
 that was available in my area :D

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53494#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list