Make WordPress Core

Opened 4 years ago

Last modified 11 days ago

#50317 new defect (bug)

Twenty-Twenty: Image Block Caption alignment is not centered on mobile version

Reported by: spanglishwebs's profile spanglishwebs Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: needs-testing has-patch
Focuses: css Cc:

Description

Summary
The caption alignment within an Image Block does not align centre on mobile device.

Steps to Reproduce

  1. Add an Image Block with a caption to a page in the theme Twenty-Twenty
  2. Align the caption to be centred, screenshot: https://d.pr/i/zus1yt
  3. View page on mobile device, caption is still aligned left, screenshot: https://d.pr/i/Y8PxJR. But it is aligned correctly on desktop.

Expected Result
I expected the Image Block caption to also be aligned centred on mobile device.

Actual Result
Image Block caption remained aligned left on mobile, but was centred correctly on desktop view.

Additional notes
This was tested on theme Twenty-Twenty, where I could also replicate the issue on a test site. Works correctly and as expected on theme Twenty-Nineteen.

Gutenberg: 8.2.1
CoBlocks: 1.23.0

Attachments (2)

50317.patch (1.2 KB) - added by sabernhardt 4 years ago.
centering .aligncenter image caption for all screen sizes
50317.1.patch (1.2 KB) - added by sabernhardt 4 years ago.
another option: centering .aligncenter captions for more blocks (including image gallery, audio and table) at any screen size

Download all attachments as: .zip

Change History (6)

#1 @sabernhardt
4 years ago

  • Component changed from General to Bundled Theme
  • Focuses css added

@spanglishwebs Thanks for the report!

Centering the caption starts at 1000 pixels and wider, which I did not expect either.

Centered text that wraps on multiple lines can be more difficult to read, so the theme authors might have intended to avoid that. However, if the caption is long enough to prefer left-aligned text, editors can leave the image block's alignment setting unselected.

@sabernhardt
4 years ago

centering .aligncenter image caption for all screen sizes

#2 @sabernhardt
4 years ago

The centering was added recently (47689), and ticket #49320 does not indicate that placing it inside the media query was intentional.

In case the style belongs outside the media query, for all screen sizes, I uploaded a patch.

@sabernhardt
4 years ago

another option: centering .aligncenter captions for more blocks (including image gallery, audio and table) at any screen size

#3 @sabernhardt
4 years ago

  • Keywords has-patch added

#4 @karmatosed
11 days ago

  • Keywords needs-testing added
  • Milestone changed from Awaiting Review to Future Release
Note: See TracTickets for help on using tickets.