-
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
Try: Zero out excerpt paragraph margins. #47538
Conversation
Size Change: -351 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
Editor: I think the collapsing between the paragraph and the read more is OK. Front: What does look strange is, for example In Twenty Twenty-Three, that there is no space between the post excerpt and the block below it. |
Would it be safer to start by adding back some margin? |
Flaky tests detected in 83096ea. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4042710064
|
But if the margin is moved from the |
Moving it to the div makes sense. Let me try in a minute. |
Hmm. Maybe we should keep the bottom margin, and not touch the Read More button for now? |
@jasmussen Thank you for working on this with such short notice. I think we want
|
Thanks @iamtakashi. That gets us to here: Is this what we want? Wouldn't that make your original doodle impossible? |
In that way, the margins added will collapse or will be removed when the excerpt block is the first or the last block in a container just like other blocks. I think I’ve tested that when I wrote the comment, but I can make sure when I back to my desk. |
I committed your change, you should be able to test it in the branch now, or on http://gutenberg.run/47538 |
Thanks for the change, @jasmussen. It works very well. The margins are present when we need them and are not there when we don't need them. |
Cool, let's see if we can get this merged. @carolinan are you able to take another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works well for me.
I tested this separately:
- If I place the excerpt in a group block with block spacing, the value in the setting is used.
- If I add top and bottom margin to the post excerpt block using theme.json, the margin in theme.json is used.
Thank you. I'll merge and will be happy to follow up. |
Nice! Ran into this the other day as well. Good stuff. |
* Try: Zero out excerpt paragraph margins. * Address feedback. * Commit change.
I just cherry-picked this PR to the release/15.1 branch to get it included in the next release: 404ba23 |
What?
Fixes #47457.
This PR attempts to zero out the paragraph margins on the post excerpt block. Before, showing the default browser-style inherited margins:
After, no margins:
Why?
Two main reasons: firstly, at the moment, the excerpt paragraph is essentially unstyled. By inheriting from the browser stylesheet, there's no connection to the rest of the site.
Note how paragraphs in the rest of the site have a more gap behavior:
There's a collapsing happening when the Read More block is filled in:
I'd like your feedback on that one. I think it looks good, but if we want to be safe, we can add some top margin to the read more block and fix this.
Testing Instructions
Test the excerpt block in the site editor.