[wp-meta] [Making WordPress.org] #8012: Incorrect use of "elements" instead of "blocks" in Theme Handbook example for nested element styles

Making WordPress.org noreply at wordpress.org
Mon Jun 16 17:15:04 UTC 2025


#8012: Incorrect use of "elements" instead of "blocks" in Theme Handbook example
for nested element styles
--------------------------+--------------------
 Reporter:  tomd6r        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  low           |  Milestone:
Component:  Handbooks     |   Keywords:
--------------------------+--------------------
 == Issue Description
 The Theme Handbook page on applying styles in theme.json contains an
 incorrect example under the “Styling elements nested in blocks” section.
 The example uses "elements" as the top-level key where it should be
 "blocks" when targeting specific core blocks like `core/pullquote`.

 === URL of the Page with the Issue
 https://developer.wordpress.org/themes/global-settings-and-styles/styles
 /applying-styles/#styling-elements-nested-in-blocks

 == Why is this a problem?
 This typo can confuse theme developers trying to target nested elements
 inside blocks. Using "elements" as the top-level key in this context is
 invalid and will not apply any styles, potentially leading to wasted
 debugging time and incorrect assumptions about how theme.json works.

 == Suggested Fix
 Update the example by replacing the top-level "elements" key with
 "blocks", as shown below:
 {{{#!json
 {
   "version": 2,
   "styles": {
     "blocks": {
       "core/pullquote": {
         "typography": {
           "fontSize": "2.25rem"
         },
         "elements": {
           "cite": {
             "typography": {
               "fontSize": "max( 50%, 1.5rem )"
             }
           }
         }
       }
     }
   }
 }
 }}}
 Also consider updating the example to use version 3 of the schema for
 consistency with current standards.

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/8012>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list