themes icon indicating copy to clipboard operation
themes copied to clipboard

Baskerville 2: Gutenberg Images blocks can't be centered

Open spncr opened this issue 8 years ago • 22 comments

Steps to replicate

Publish a gutenberg post or page with a centered image block.

Result

screen shot 2018-11-29 at 12 13 23 pm

Temporary Fix

  • use a Classic block

OR

  • use this CSS to fix it:
.wp-block-image .aligncenter {
  text-align: center;
}
  • User report: #8320024-hc
  • Follow-up ticket: #1607315-zen
  • User's site: https://bookgeeksunc.com/2018/11/26/skyward-skyward-1/ (temporarily fixed with appended CSS)

spncr avatar Nov 29 '18 20:11 spncr

Hey @spencerberry! This sounds like it might be this issue, which is affecting more than one theme:

https://github.com/Automattic/wp-calypso/issues/28756

I'm going to close this theme-specific issue, but if you have any questions please let me know!

laurelfulford avatar Nov 29 '18 21:11 laurelfulford

Actually, scratch that, I misspoke -- I think the issues in that other thread are theme-related :|

It looks like it happens when a theme applies the style display: block to elements with the class .aligncenter. The image block uses display: table, so the display block messes that up.

laurelfulford avatar Nov 29 '18 22:11 laurelfulford

Reported with similar issue: #9967532-hc Followup ticket: #1760525-zen

To align image captions under the image block, we can apply the following below:

.wp-block-image .aligncenter>figcaption {
    display: block;
}

edwinho89 avatar Jan 30 '19 10:01 edwinho89

From https://github.com/Automattic/wp-calypso/issues/28756#issuecomment-459014528

Another case, on a site with the Baskerville 2 theme:

When the image is resized and centered in the editor, it shows as left-aligned in the frontend. We added display:block; to the CSS as a temporary workaround. hc-9976478

Aurorum avatar Jan 30 '19 16:01 Aurorum

Switching the priority on this one, since Baskerville doesn't have Gutenberg styles in the theme yet.

laurelfulford avatar Feb 04 '19 23:02 laurelfulford

Another report here, from #595 (hat tip @scosgro!):

  • User report: 1795750-zen
  • Follow-up ticket: 1795750-zen

laurelfulford avatar Feb 12 '19 23:02 laurelfulford

This came up in 10230156-hc

jessestu avatar Mar 01 '19 00:03 jessestu

Another report of this here: 1919494-zen

rezzap avatar Mar 30 '19 10:03 rezzap

+1 7649849-hc

In case user doesn't have Custom CSS, can suggest using Classic block.

formosattic avatar Apr 01 '19 05:04 formosattic

Another report of this here: #497193-hc

thabotswana avatar Apr 05 '19 14:04 thabotswana

My problem is solved by adding CSS but I wonder whether this fix will be incorporated into the theme itself. Seems like a better way to go.

christianboyce avatar Apr 09 '19 14:04 christianboyce

Reported here too: #1953372-hc

Any chance somebody could post the CSS workaround here? I am unable to find it. It may be a suitable solution for this user for now.

eamcgill90 avatar Apr 11 '19 00:04 eamcgill90

Here you go, with instructions: Go to Appearance, then Customize, then Additional CSS. Add this to whatever is there:

.wp-block-image .aligncenter>figcaption { display: block; } Also add this: .wp-block-image .aligncenter { text-align: center; }

That works for me on my site, https://oneminutemacman.com. Good luck!

christianboyce avatar Apr 11 '19 04:04 christianboyce

Another report in #13689395-hc

aleone89 avatar Jun 28 '19 07:06 aleone89

FWIW I came across this again today #9210244-hc

kristarella avatar Jul 09 '19 04:07 kristarella

Another report in #11463287-hc Follow up #2240805-zen

rinazrina avatar Aug 01 '19 14:08 rinazrina

Reported in #15980481-hc. Gave the above CSS as a workaround

GeoJunkie avatar Oct 15 '19 17:10 GeoJunkie

✅ Fixed upstream on r54559-wpcom-themes. (Baskerville)

mendezcode avatar Oct 23 '19 21:10 mendezcode

Provided CSS workaround to user in #2528694-zd, appears to still be an issue

msilbers avatar Nov 30 '19 20:11 msilbers

Another case: #2541997-zen. The user is on Personal Plan and can't use CSS.

suyogyashukla avatar Dec 09 '19 18:12 suyogyashukla