[wp-trac] [WordPress Trac] #60936: Layout: Output of base layout rules conflicts with wide alignment of blocks in classic themes

WordPress Trac noreply at wordpress.org
Fri Apr 5 05:19:22 UTC 2024


#60936: Layout: Output of base layout rules conflicts with wide alignment of blocks
in classic themes
--------------------------+-----------------------------
 Reporter:  andrewserong  |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  6.5.1
Component:  Editor        |    Version:  trunk
 Severity:  normal        |   Keywords:  gutenberg-merge
  Focuses:                |
--------------------------+-----------------------------
 As reported in the Gutenberg repo in
 https://github.com/WordPress/gutenberg/issues/60413 there is a bug in
 WordPress 6.5 with base layout rules that are applied to container blocks
 such as Group in Classic themes. The bug appears to have been introduced
 in #60130 and results in layout rules being applied to children of the
 Group block, with `max-width` rules being output that reference CSS
 variables that don't exist in Classic themes (or more specifically, themes
 that do not set `settings.layout.contentSize` or
 `settings.layout.wideSize` in `theme.json`).

 A solution (also proposed in the Gutenberg repo) in
 https://github.com/WordPress/gutenberg/pull/60489 is to skip outputting
 the `max-width` rules that reference contentSize or wideSize CSS variables
 if the contentSize and wideSize values are not available.

 This should restore the previous behaviour for Classic themes such as
 TwentyTwenty, without affecting block themes in any way.

 For full reproduction steps of the issue, please see
 https://github.com/WordPress/gutenberg/issues/60413

 A short version is:

 1. Activate Twenty Twenty theme
 2. Add a Group block to a post or page, set its alignment to Full
 3. Add a Cover or Group block as a child of that block, and set it to an
 alignment of Wide
 4. Notice that on the site frontend, the block extends to the full width
 of the container, and not the desired Wide width

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60936>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list