-
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
Add spacing controls to all heading blocks #35772
Conversation
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.
Works in for each of the three blocks enabled, in my testing.
Just noting for testing purposes that |
Of the two PR options, I prefer this one. |
One problem we have is that the margin control looks identical to the padding control, and it's way too easy to confuse these two for the casual user. Apply either on a block with no background, and things will in many cases look as if they are the same. (#33221 is a good conversation about that) Because of that problem, though, I'm uncomfortable adding both padding and margin at the same time. Could we add only margin to these, and then revisit padding in the future? |
We could, however the site title and tagline block already have both of these controls available. So either way we're going to have to address this UI issue. Of the two controls, I think margin is probably the more problematic one, for the reasons noted in this other issue. I'll hold off on merge while we sort this out. |
Chatted with @jasmussen a bit more on slack, and he pointed out that specifically for headings blocks, padding might be a weird control to have. It'll work identically to Margin in most cases. Padding generally makes more sense for blocks that could contain other blocks. Anyway I updated the PR to only add margin support. We can always add padding later if we reconsider. It's a simple PR. 🙂 |
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.
LGTM
Fixes #35522.
This is a more expansive version of #35684.
When creating patterns and templates, I find myself needing padding and/or margin support most frequently on headings. In particular, they tend to require additional space above or below them so that they comfortably flow with the rest of the text. The Site Title block already has these controls, but other heading blocks do not. This fixes that by adding margin + padding controls to all blocks that generate headings:
To test:
Try the following block markup, and note that the padding + margins appear as expected in both the front end and editor:
Screenshot