[wp-trac] [WordPress Trac] #57904: Per-level styling of heading blocks does not work

WordPress Trac noreply at wordpress.org
Mon Mar 13 14:19:51 UTC 2023


#57904: Per-level styling of heading blocks does not work
------------------------------+---------------------
 Reporter:  wongjn            |       Owner:  (none)
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  6.2
Component:  Themes            |     Version:  trunk
 Severity:  normal            |  Resolution:
 Keywords:  has-testing-info  |     Focuses:
------------------------------+---------------------
Changes (by hellofromTonya):

 * keywords:   => has-testing-info


Comment:

 == Testing Instructions
 These steps define how to reproduce the issue, and indicate the expected
 behavior.

 === Steps to Reproduce
 1. Open the Twenty Twenty-Three theme's `theme.json` in your favorite code
 editor.
 2. Find `"styles" > "blocks" on about line 291.
 3. Add the following json to as the first element under `"blocks"` (above
 `"core-navigation"`):
 {{{
 "core/heading" : {
   "elements": {
         "h1": {
           "color": {
                 "background": "pink"
           }
         }
   }
 },
 }}}
 4. Save the file.
 5. Launch your test suite.
 6. On the front-end, open your browser's Dev Tools interface.
 7. In the "Inspector" search for `.wp-block-heading-inline-css`. 🐞 Bug
 occurs.

 === Expected Results
 When testing a patch to validate it works as expected:
 - ✅ The generated CSS for the `h1` should be
 {{{
 h1.wp-block-heading{background-color: pink;}
 }}}

 When reproducing a bug:
 - ❌ The generated CSS for the `h1` is incorrectly set as:
 {{{
 .wp-block-heading h1{background-color: pink;}
 }}}

 the full style (at the time of this comment):
 {{{
 <style id="wp-block-heading-inline-css">
 h1.has-background,h2.has-background,h3.has-background,h4.has-background,h5
 .has-background,h6.has-background{
   padding:1.25em 2.375em;
 }
 .wp-block-heading h1{background-color: pink;}
 </style>
 }}}

   **Test Report Icons:**
   🐞 <= Indicates where issue ("bug") occurs.
   ✅ <= Behavior is ''expected''.
   ❌ <= Behavior is ''NOT expected''.

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


More information about the wp-trac mailing list