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

Block-image Caption Does Not Center for images < 608px #5834

Closed
2 tasks
weavertheme opened this issue Mar 28, 2018 · 2 comments
Closed
2 tasks

Block-image Caption Does Not Center for images < 608px #5834

weavertheme opened this issue Mar 28, 2018 · 2 comments
Labels
[Feature] Media Anything that impacts the experience of managing media [Type] Bug An existing feature does not function as intended

Comments

@weavertheme
Copy link

weavertheme commented Mar 28, 2018

Issue Overview

This is for Gutenberg Version 2.4.0

The wp-block-image caption apparently is meant to be centered under the image. If the image is less than 608px wide (at least in my tests, 608px seems to be the maximum width for wp-block-image width), then the caption is not properly centered. This non-centering can be seen in both the editor view, and in the front-end view for most themes.

Steps to Reproduce (for bugs)

  1. Add an image to a wp-block-image, preferably < 500px width or so to most easily see image.
  2. Add a caption.
  3. The caption will not be centered under the image in the editor, and most themes.
  4. The non-centering can also be more apparent in themes with wide content width.

Expected Behavior

The wp-block-image caption should always center under the image, no matter what the width is.

Current Behavior

Possible Solution

This seems to be related to the display:block on the wp-block-image styling. Changing the style to
.wp-block-image { display: inline-block !important; }
will fix the centering in both the visual editor and the front-end view. BUT, that leaves an undesirable side effect in that a pair of narrow enough images will not break in the front-end view (they display side by side), but do in the editor because it has some other wrapping blocks that cause a break in the editor DOM version.

Screenshots / Video

Related Issues and/or PRs

Todos

  • Tests
  • Documentation
@jeffpaul jeffpaul added [Type] Bug An existing feature does not function as intended [Feature] Media Anything that impacts the experience of managing media labels Mar 29, 2018
@jasmussen
Copy link
Contributor

This will be fixed by #5706.

@jorgefilipecosta
Copy link
Member

Closing this issue as #5706 was already merged and the problem should now be fixed.
Thank you for reporting the issue @weavertheme!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Media Anything that impacts the experience of managing media [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants