WordPress.org

Make WordPress Core

Opened 5 months ago

Last modified 3 months ago

#47290 new defect (bug)

Image can’t align center inside block column

Reported by: hklcf Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords:
Focuses: ui, template Cc:
PR Number:

Description

block editor preview https://img.eservice-hk.net/upload/2019/05/16/161450_5b1e7db44114840141f38ee9aa5eed82.png

actualhttps://img.eservice-hk.net/upload/2019/05/16/161426_676ad4ec6bfa21757f14f398967499ac.png

demo: http://232.email/myav/2019/05/16/7/

Attachments (1)

Screen Shot 2019-07-24 at 12.40.28 AM.png (1.1 MB) - added by garrett-eclipse 3 months ago.
Issue illustrated w/ inspector to show the CSS and how it affects the figure element

Download all attachments as: .zip

Change History (4)

#1 @SergeyBiryukov
5 months ago

  • Component changed from Themes to Editor

This ticket was mentioned in Slack in #core by desrosj. View the logs.


5 months ago

#3 @garrett-eclipse
3 months ago

  • Component changed from Editor to Bundled Theme

Thanks for the report @hklcf I was able to reproduce this with a clean install of WP using the Twenty Nineteen theme.

Upon inspect I found the theme CSS sets a calculated width on the centered figure element surrounding the image. This causes the element to extend beyond the bounds of the column causing it's centered child image to be displaced out of the column.

Setting to 100% width when in a column block seems to resolve the issue but should be looked at in the bundled theme where this is applied.

I believe this is the SCSS which controls that width in the theme CSS;
https://github.com/WordPress/WordPress/blob/master/wp-content/themes/twentynineteen/sass/blocks/_blocks.scss#L533-L553

Moving into the Bundled Theme component for further review.

@garrett-eclipse
3 months ago

Issue illustrated w/ inspector to show the CSS and how it affects the figure element

Note: See TracTickets for help on using tickets.