Baskerville 2: Gutenberg Images blocks can't be centered
Steps to replicate
Publish a gutenberg post or page with a centered image block.
Result

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)
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!
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.
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;
}
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
Switching the priority on this one, since Baskerville doesn't have Gutenberg styles in the theme yet.
Another report here, from #595 (hat tip @scosgro!):
- User report: 1795750-zen
- Follow-up ticket: 1795750-zen
This came up in 10230156-hc
Another report of this here: 1919494-zen
+1 7649849-hc
In case user doesn't have Custom CSS, can suggest using Classic block.
Another report of this here: #497193-hc
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.
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.
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!
Another report in #13689395-hc
FWIW I came across this again today #9210244-hc
Another report in #11463287-hc Follow up #2240805-zen
Reported in #15980481-hc. Gave the above CSS as a workaround
✅ Fixed upstream on r54559-wpcom-themes. (Baskerville)
Provided CSS workaround to user in #2528694-zd, appears to still be an issue
Another case: #2541997-zen. The user is on Personal Plan and can't use CSS.