[wp-trac] [WordPress Trac] #60981: 6.5 adds the "is-layout-constrained" class to the wrong place for classic themes

WordPress Trac noreply at wordpress.org
Wed Apr 10 15:24:51 UTC 2024


#60981: 6.5 adds the "is-layout-constrained" class to the wrong place for classic
themes
--------------------------+-----------------------------
 Reporter:  evanltd       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Themes        |    Version:  6.5
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Prior to 6.5, when using a classic theme that does not include a
 theme.json file, the frontend html output of a group block looked like
 this:

 {{{
 <div class="wp-block-group is-layout-constrained wp-block-group-is-layout-
 constrained">
      <div class="wp-block-group__inner-container">
 </div>
 </div>
 }}}

 After 6.5, the frontend output of a group block looks like this:

 {{{
 <div class="wp-block-group">
      <div class="wp-block-group__inner-container is-layout-constrained wp-
 block-group-is-layout-constrained">     </div>
 </div>
 }}}

 Note how the **is-layout-constrained** classes moved from the outer div to
 the inner div.
 Yes I have verified the difference with a fresh install of WP.

 This causes a cascade of problems:

 This WP global inline CSS rule, which perviously only applied to the inner
 container itself, now gets undesirably applied to EVERY (non-aligned)
 regular child element inside a group div:

 {{{
 body .is-layout-constrained >
 :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
 margin-left: auto !important;
 margin-right: auto !important;
 }}}

 The CSS rule is awkward and difficult to override due to the !important
 flags.
 Completely disabling the global inline CSS output is not a great solution,
 as we still want to retain parts of it.
 We have no option to remove the is-layout-constrained class in the post
 editor. (Themes that do not include a theme.json + layout data, do not
 display the Layout settings pane at all in the editor).

 This 6.5 change has broken layouts in all of my sites that use the group
 block. I have not verified whether other block types are affected.

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


More information about the wp-trac mailing list