[wp-trac] [WordPress Trac] #61769: Global Styles: Prevent empty CSS rules and malformed selectors for custom css for blocks

WordPress Trac noreply at wordpress.org
Wed Aug 14 18:55:42 UTC 2024


#61769: Global Styles: Prevent empty CSS rules and malformed selectors for custom
css for blocks
-------------------------------------------------+-------------------------
 Reporter:  aaronrobertshaw                      |       Owner:
                                                 |  hellofromTonya
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.6.2
Component:  Editor                               |     Version:  6.6
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  gutenberg-merge has-patch has-unit-  |     Focuses:
  tests has-testing-info commit                  |
-------------------------------------------------+-------------------------
Changes (by hellofromTonya):

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


Comment:

 In [changeset:"58896" 58896]:
 {{{
 #!CommitTicketReference repository="" revision="58896"
 Editor: Fix block custom CSS pseudo element selectors in global styles.

 Fixes a regression introduced in [58241] where selectors with pseudo
 elements are wrapped within `:where()` causing malformed CSS and the CSS
 rule(s) not being applied.

 When processing custom CSS for blocks, this changeset:

 * Strips the pseudo-elements from the original nested selector, performs
 the required wrapping in `:root :where`, then re-appends the pseudo-
 element selector with its leading combinators if present.
 * Removes empty CSS rules.

 It includes the PHP changes.

 Reference:
 * PHP changes from [https://github.com/WordPress/gutenberg/pull/63980
 Gutenberg PR 63980].

 Follow-up to [58241], [56812], [55216].

 Props aaronrobertshaw, wongjn, harlet7, dballari, ramonopoly,
 andrewserong, aristath, hellofromTonya.
 Fixes #61769.
 }}}

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


More information about the wp-trac mailing list