[wp-trac] [WordPress Trac] #63589: Unable to live preview changes to Additional CSS in the Customizer when using a Block Theme

WordPress Trac noreply at wordpress.org
Tue Jul 8 02:59:42 UTC 2025


#63589: Unable to live preview changes to Additional CSS in the Customizer when
using a Block Theme
-------------------------------------+--------------------------
 Reporter:  westonruter              |       Owner:  westonruter
     Type:  defect (bug)             |      Status:  accepted
 Priority:  normal                   |   Milestone:  6.9
Component:  Customize                |     Version:  6.2
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+--------------------------
Changes (by westonruter):

 * keywords:  has-patch changes-requested => has-patch needs-testing


Comment:

 @wildworks Thanks for catching this. I was able to reproduce the issue.

 I've updated the PR with a fix, to ensure the global styles are always
 printed even in the Customizer, and to print Customizer's Custom CSS
 separately ''before'' the global styles so that the can be updated with
 live preview and so that the cascade is preserved, where Custom CSS in
 global styles are intended to override Customizer's Custom CSS.

 Note: Originally the Customizer's Custom CSS was intended to override all
 other styles, so it was printed at `wp_head` with a priority of 101, which
 is far after `wp_print_styles()` runs at priority 8. This allowed the
 Customizer's Custom CSS to easily override CSS from themes and plugins,
 without having to resort to increased selector specificity or `!important`
 properties. However, in block themes the Custom CSS in global styles is
 now intended to take precedence (apparently), so this is why the order is
 changed in a block theme.

 I've also updated the Gutenberg PR:
 https://github.com/WordPress/gutenberg/pull/70428

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


More information about the wp-trac mailing list