Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v8.0.0-RC1: Image block sits outside of perceived conatiner in editor (Twenty Twenty theme) #21961

Closed
andrewserong opened this issue Apr 29, 2020 · 5 comments · Fixed by #21971
Labels
[Block] Image Affects the Image Block Needs Testing Needs further testing to be confirmed.
Milestone

Comments

@andrewserong
Copy link
Contributor

andrewserong commented Apr 29, 2020

Describe the bug
In v8.0.0-RC1 and the Twenty Twenty theme enabled, within the editor the image block sits outside of the central 'container' of the page.

This issue is related to #21885 and #21911 (but this issue is about when no alignment is set).

It looks like this is to do with the change in #21822 where the wrapper div was removed from the Image block in the editor. This change means that the following styling in the Twenty Twenty theme now overrides the margins that should centre the block:

.editor-styles-wrapper figure {
  margin: 0;
}

Whereas if you disable the plugin, then the wrapper div element is targeted by

.edit-post-visual-editor .block-editor-block-list__block {

This particular selector was removed in #20951 at this line. A solution to this issue could be either to fix this in Twenty Twenty, or add back in the div wrapper to the Image block to mitigate the specificity issue.

To reproduce
Steps to reproduce the behavior:

  1. Activate the Twenty Twenty theme on your site
  2. Add an Image block and select any image and set it to left aligned
  3. Instead of the image block being centered within the perceived container of the page, the image is left aligned outside of that 'container'.

Expected behavior
The image block to sit within the perceived 'container' of the page in Twenty Twenty as it does on the front end.

Screenshots

Before (WordPress 5.4, plugin disabled)

image

After (WordPress 5.4, plugin v8.0.0-RC1 enabled)

image

Editor version (please complete the following information):

  • WordPress version: 5.4, Gutenberg v8.0.0-RC1

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome 81
@andrewserong
Copy link
Contributor Author

andrewserong commented Apr 29, 2020

CC @aduth — I'm not sure if this is a blocking issue, but thought I'd mention it since you released RC 1 🙂

@aduth
Copy link
Member

aduth commented Apr 29, 2020

@youknowriad As author of #21822 and #20951, do you have any thoughts on what might need to change here?

@aduth aduth added the [Block] Image Affects the Image Block label Apr 29, 2020
@aduth aduth added this to the Gutenberg 8.0 milestone Apr 29, 2020
@aduth aduth added the Needs Testing Needs further testing to be confirmed. label Apr 29, 2020
@aduth
Copy link
Member

aduth commented Apr 29, 2020

Possibly related fix: #21971

@oandregal
Copy link
Member

Tested and can confirm that #21971 fixes this as well.

@andrewserong
Copy link
Contributor Author

Thank you for the quick fix on this one and getting it in for v8.0.0! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block Needs Testing Needs further testing to be confirmed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants