-
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
Fixed the issue of extra padding of the heading #40180
base: trunk
Are you sure you want to change the base?
Fixed the issue of extra padding of the heading #40180
Conversation
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @aezazs-multidots! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
@aezazs-multidots while the default |
|
@ndiego |
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 PR @aezazs-multidots!
These css variables are used in other places too and it's going to be a breaking change, because it will affect the styles of existing content.
@jasmussen do you know if we have changed in the past similar values of css variables and the steps taken?
Indeed, this padding is also used for Paragraphs. Nick has a good point about In that light, moving to use Alternatively: we should remove those variables entirely, and no longer apply a padding at all, just because a block has a background. We've already stopped doing this with new blocks such as Quote and List, and generally these preset styles should be absorbed by design tools and global styles. That's a larger undertaking, though, but in terms of picking between breaking changes, it might be the right one? |
Hello @jasmussen @ntsekouras When we set the background color of the text of the paragraph and heading block, then we should remove the padding? |
Just noting that the variables are used in more blocks(Group, Template Part, etc..). Just search the code for I'm not sure yet, but maybe we could handle some changes by removing or updating the specific styles from some blocks at first and not change the variable values. Also we should see if the affected blocks have |
Hello @jasmussen @ntsekouras When we set the background color to headings and paragraphs, then only we should remove the padding. Because of this, it will not have any effect anywhere else. Please share your thoughts on this. |
Hello @jasmussen So I replace Thanks |
In retrospect, I wish padding was never added. Removing the padding would be a pretty drastic breaking change for some users, but it reduces the opinionation of core styles. At this point, you all know how much I love dimension controls, so I would love to see padding support added to these blocks and the default padding CSS removed. 😂 But that said, I agree that switching to |
@aezazs-multidots @jasmussen @ndiego Is this still a change that should be merged? |
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Issue: headings and paragraphs get an intrinsic padding when a background is applied, and this padding is set in ems so it looks like this: Coming back to this one. We have three options:
Unfortunately I don't think we can do either 1 or 2, simply because this has been out there for years now. It would in most ways, be a breaking change. I also like to think that with the addition of better padding tools, so you can explicitly zero out paddings if you want, this is less of a headache. That, and you might probably be grouping elements together, then applying the background on the group itself, rather than the element directly. For all those reasons, I'd think we can close this one. |
What?
Fixed the extra padding that was added in the heading block H1 tag.
Why?
When we used the H1 tag in the heading block and added the background color of this H1 tag, the design was getting spoiled due to too much extra padding. We have solved that issue in this PR.
Testing Instructions
Screenshots or screencast
After creating PR the issue is solved.
Environment info
WordPress Version:- 5.9.3
WordPress Theme :- Twenty Twenty-Two / Twenty Twenty-One
Browser: Google Chrome 100.0.4896.75 (Official Build) (arm64)
OS Version: Mac 12.2.1