Gutenberg: Layout List-Block in Editor broken in some Themes since WP 5.5

Created on 25 Aug 2020  Â·  5Comments  Â·  Source: WordPress/gutenberg

Describe the bug
Since WP 5.5 the layout of the regular List-Block is broken in Gutenberg in some Themes (tested with Twenty Fourteen, Twenty Sixteen, Twenty Seventeen).
While the resulting webpage seems to be always OK, in Gutenberg editor the List-Block in the stated themes is shown on the left screen side, outside of the boundary of the regular editor content:

WP55_LayoutListBlock_broken

It's OK in some other Themes (tested with Twenty Twelve, Twenty Nineteen, Twenty Twenty):
WP55_LayoutListBlock_OK

To reproduce
Steps to reproduce the behavior:

  1. Select one of the problematic themes (2014/2016/2017)
  2. Use a regular List-Block in combination with other blocks (paragraph, ...)
  3. See the problem

Expected behavior
WYSIWYG
(Like in WP 5.4 and before)

Editor version (please complete the following information):

  • WordPress version: 5.5
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? Tested with default and Gutenberg => both with same problem
  • If the Gutenberg plugin is installed, which version is it? 8.8.0

Desktop (please complete the following information):

  • OS: Win10
  • Browser: tested with Firefox + Chrome
  • Version last version
Needs Testing [Feature] Themes

All 5 comments

I wonder if this is some kind of conflict with editor styles. cc @kjellr @jasmussen @melchoyce

I can reproduce. Twenty Fourteen:

Screenshot 2020-08-27 at 08 43 03

Many themes handle wide and fullwide by using "margin-left: auto; margin-right: auto;" — when I explicitly add that back, it looks like this, which I _think_ is correct:

Screenshot 2020-08-27 at 08 43 28

Diving in deeper, it looks like there's a generic .wp-block style in the Twenty Fourteen editor style that does exactly that:

Screenshot 2020-08-27 at 08 43 57

But said style is overwritten by other editor style CSS, in the case of the list block:

Screenshot 2020-08-27 at 08 44 16

Specifically this from the very same editor style:

Screenshot 2020-08-27 at 08 46 50

I'm not entirely sure why that worked in 5.4 and broke now, because it seems like that latter style would always take precedence. However it's possible that the general code cleanup and reduction in CSS specificity efforts we've done, are causing some side effects here.

_Ideally_ the solution would be for the Twenty Fourteen editor style, and others, to be rewritten to adress this.

Interesting. I actually fixed this for Twenty Fifteen earlier this year:

https://core.trac.wordpress.org/ticket/50029

At the time I didn't realize it was effecting other themes as well. As you noted @jasmussen the theme styles are interfering with this, so the best route would be to fix this in the themes themselves. I've created a new ticket here to track these fixes:

https://core.trac.wordpress.org/ticket/51157

Thank you Kjell!

Thanks all. Closing in favor of the trac ticket.

Was this page helpful?
0 / 5 - 0 ratings