-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
.wp-block-image margin-bottom is incorrectly applied when aligned left/right #16241
Comments
Related? woocommerce/storefront#1165 |
@tiagonoronha didn't specify the source of the misaligning when the ticket was reported, so there's no way to be absolutely certain. I'd agree with you, @GlennMartin1, because based on the diff that ticket does look like it's reporting this same issue. The fix that theme implemented is that I would implement in my themes, if there was not going to be a fix for this in Gutenberg. |
Definitely looks like something is awry. Here's what I see when I follow the steps to reproduce using latest Gutenberg + Twenty Twenty: And here's it using latest Gutenberg + Twenty Nineteen: I'm unsure if this is an issue in the block editor that's being patched by Twenty Twenty, or if this is an issue in Twenty Nineteen. Adding |
We chatted about this issue in today's design meeting (Slack). It's really difficult to match paragraph and image placements for right/left images. We could probably get it right for baseline/default Gutenberg styles - but not for every theme out there. It's dependent on font size, line height, paragraph margin/padding as well. |
In the theme I screenshot, the paragraph had no margin-top; the theme uses margin-bottom to space between paragraphs. The Maybe Twenty Twenty uses margin-top on paragraphs, and that's why it matches, where Twenty Nineteen uses margin-bottom, and that's why it doesn't match. My questions are:
|
Is this issue still valid? |
I don't know. My earlier comment was using Storefront, but it's been addressed there (see woocommerce/storefront#1165). |
Describe the bug
The problem is that a
.wp-block-image
block with analignright
image retains the margin-bottom on the parent element, and as a result the following paragraph tag does not align with the top of the image/To reproduce
Steps to reproduce the behavior:
Expected behavior
I expect the top of the image to be level with the top of the adjacent paragraph tag.
Screenshots
Desktop (please complete the following information):
Suggested fix
.wp-block-image
in /wp-includes/css/dist/block-library/style.min.css?ver=5.2.2<figure>
element in the optional styles that themes can opt out of. Themes generally provide their own margin styles for.alignright
.The text was updated successfully, but these errors were encountered: