[wp-trac] [WordPress Trac] #64150: Late-printed styles are not hoisted to HEAD if wp-block-library is not enqueued
WordPress Trac
noreply at wordpress.org
Wed Mar 11 20:56:17 UTC 2026
#64150: Late-printed styles are not hoisted to HEAD if wp-block-library is not
enqueued
--------------------------------------+--------------------------
Reporter: westonruter | Owner: westonruter
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 6.9
Component: Script Loader | Version: 6.9
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests | Focuses: performance
--------------------------------------+--------------------------
Comment (by westonruter):
In [changeset:"61945" 61945]:
{{{
#!CommitTicketReference repository="" revision="61945"
Script Loader: Refine hoisted stylesheet ordering to preserve original CSS
cascade in classic themes.
This introduces placeholder inline `STYLE` tags in the `HEAD` which are
used to accurately locate hoisted styles which were printed in the footer.
This improves the robustness of the hoisting logic. A style placeholder
had been used previously in the inline style for `wp-block-library` for
placing core block styles, and new placeholders are added for global
styles and non-core block styles.
Furthermore, this fixes the cascade for inline styles added to `wp-block-
library`. When separate block styles are not used, these styles would have
appeared after the single combined `wp-block-library`. However, in 6.9 the
order changed so that separate block styles would appear after. To
preserve the original cascade, this splits the `wp-block-library` inline
style: the first half (likely just the inlined `block-library/common.css`)
appears before the block styles, and the remainder appears in a new `STYLE
#wp-block-library-inline-css-extra` element.
Developed in https://github.com/WordPress/wordpress-develop/pull/10875
Follow-up to r61554, r61174, r61122, r61076, r61008.
Props westonruter, joefusco, adamsilverstein, ocean90, mmorris8, ozgursar,
vanonsopensource, xwolf, immeet94, george9, joezappie, jorbin, sajib1223,
sabernhardt.
See #64099, #64354, #64150, #43258.
Fixes #64389.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64150#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list