[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
Mon Jul 28 00:34:24 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:
-------------------------------------+--------------------------

Comment (by westonruter):

 Replying to [comment:17 wildworks]:
 > It may be difficult to solve everything, but I discovered another
 inconsistency while testing the latest patch.

 I believe this is what I [comment:16 called out] above:

 > 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.

 In particular, in a Block Theme, the Site Editor's styles are intended to
 be printed after the Customizer's styles to give the Site Editor's style
 priority. In order to preserve that priority, then in the Customizer the
 `style` is printed before the global styles. But this does lead to the
 inconsistency. The only way to address that would be to not have the
 Customizer's styles printed separately, but instead to have the Customizer
 preview update the custom CSS inline in the global styles, before the Site
 Editor's Additional CSS are added to the end. This may be doable.

 > Another thing I noticed is that the post editor or site editor doesn't
 seem to enqueue the additional CSS defined in the Customizer in the first
 place.
 >
 > This means that if you follow the testing steps above, the text color
 should be a different red from the green on the frontend.
 >
 > This appears to be happening in at least 6.7 as well.

 I see the same thing. The Customizer's Additional CSS is not added to the
 Site Editor. This would be a separate issue.

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


More information about the wp-trac mailing list