-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Post Title: Add padding support #43457
Post Title: Add padding support #43457
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.
Thanks for looking into these PRs, @ndiego!
One of the things I noticed when I was working on a similar PR for the Post Date block (#43406) is that I needed to add a box-sizing: border-box
CSS rule in order for the padding to be consistent with other blocks that already have padding controls (e.g. Group block) while running TwentyTwentyTwo.
In the Group block's CSS, this is where the styling rule is set:
gutenberg/packages/block-library/src/group/style.scss
Lines 2 to 3 in b0f6704
// This block has customizable padding, border-box makes that more predictable. | |
box-sizing: border-box; |
Here's an example of the Post Title block set next to a Group block, both with the same padding value:
What do you think about adding the same rule for the Post Title block?
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.
+1 for the box-sizing
suggestion.
Added this PR to the tracking issue as well.
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.
Thanks for the update @ndiego!
✅ Padding is working as expected in the post editor
✅ Padding is working as expected in the site editor and set in global styles
LGTM! ✨
Related:
What?
Add padding support to the Post Title block.
Why?
To create consistency across blocks. This also allows users to override padding applied to Post Title blocks when there is a background color.
How?
Added the relevant block support in block.json
Testing Instructions
Screenshots or screencast