[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 17:47: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:  reviewing
 Priority:  normal                               |   Milestone:  6.6.2
Component:  Editor                               |     Version:  6.6
 Severity:  normal                               |  Resolution:
 Keywords:  gutenberg-merge has-patch has-unit-  |     Focuses:
  tests has-testing-info                         |
-------------------------------------------------+-------------------------
Changes (by hellofromTonya):

 * keywords:  gutenberg-merge has-patch has-unit-tests => gutenberg-merge
     has-patch has-unit-tests has-testing-info


Comment:

 == Test Report
 This report validates that the indicated patch addresses the issue.

 Patch tested: https://github.com/WordPress/wordpress-develop/pull/7097

 === Environment
 - OS: macOS
 - Web Server: Core's Docker instance
 - PHP: 7.4.29
 - WordPress: 6.7-alpha-58576-src
 - Browser: Firefox 129.0.1
 - Theme: Twenty Twenty-Four
 - Active Plugins: None

 === Actual Results

 ==== When reproducing a bug/defect:
 - ❌ 'Foo' is not added to the start of each header.
 - ❌ the generated CSS is not expected:

 {{{
 :root :where(.wp-block-heading::before ){content: 'Foo'}
 }}}

 Also noting, the following empty CSS exists, which is not expected:

 {{{
 :root :where(.wp-block-heading){}
 }}}

 ==== When testing the bugfix patch:
 - ✅ 'Foo' is added to the start of each header.
 - ✅ The generated CSS is as expected.

 {{{
 :root :where(.wp-block-heading)::before{content: 'Foo'}
 }}}

 - ✅ The empty CSS no longer exists.

 === Observations

 Using the provided testing instructions, I'm able to reproduce the
 reported issue and the patch resolves it.

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


More information about the wp-trac mailing list