[wp-trac] [WordPress Trac] #64099: Load block styles on demand in classic themes via template enhancement output buffer

WordPress Trac noreply at wordpress.org
Fri Nov 7 04:28:01 UTC 2025


#64099: Load block styles on demand in classic themes via template enhancement
output buffer
--------------------------------------+--------------------------
 Reporter:  westonruter               |       Owner:  westonruter
     Type:  enhancement               |      Status:  closed
 Priority:  normal                    |   Milestone:  6.9
Component:  Script Loader             |     Version:
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:  performance
--------------------------------------+--------------------------
Changes (by westonruter):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"61174" 61174]:
 {{{
 #!CommitTicketReference repository="" revision="61174"
 Script Loader: Improve hoisted stylesheet ordering (in classic themes) to
 preserve CSS cascade.

 This ensures that on-demand block styles are inserted right after the `wp-
 block-library` inline style whereas other stylesheets not related to
 blocks are appended to the end of the `HEAD`. This helps ensure the
 expected cascade is preserved. If no `wp-block-library` inline style is
 present, then all styles get appended to the `HEAD` regardless.

 The handling of the CSS placeholder comment added to the `wp-block-
 library` inline style is also improved. It is now inserted later to ensure
 the inline style is printed. Additionally, when the CSS placeholder
 comment is removed from the `wp-block-library` inline style, the entire
 `STYLE` tag is now removed if there are no styles left (aside from the
 `sourceURL` comment).

 Lastly, the use of the HTML Tag Processor is significantly improved to
 leverage `WP_HTML_Text_Replacement`.

 Developed in https://github.com/WordPress/wordpress-develop/pull/10436

 Follow-up to [61008].

 Props westonruter, peterwilsoncc, dmsnell.
 Fixes #64099.
 }}}

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


More information about the wp-trac mailing list