wordpress-develop icon indicating copy to clipboard operation
wordpress-develop copied to clipboard

Further preserve original CSS cascade when hoisting late-printed styles

Open westonruter opened this issue 1 month ago • 8 comments

Trac ticket: https://core.trac.wordpress.org/ticket/64354

TODO

  • [x] Add test for when classic-theme-styles is not enqueued.
  • [x] Add test for when global-styles is not enqueued.
  • [x] Ensure that block styles enqueued at enqueue_block_assets will get printed after classic-theme-styles via enqueue_block_styles_assets().

Note that we do not need to consider what wp_enqueue_registered_block_scripts_and_styles() outputs because it short-circuits if wp_should_load_block_assets_on_demand() is enabled, and wp_hoist_late_printed_styles() will not run when on-demand loading is disabled.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

westonruter avatar Dec 05 '25 07:12 westonruter