-
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
Buttons: add box-sizing:border-box rule #65716
Conversation
Size Change: +40 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
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. |
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 cleaning this up @t-hamano ✨
I think this rule is necessary for wp-block--based blocks that support padding.
Any block that has border support also really needs the box-sizing: border-box
style.
I consider adding box-sizing an enhancement rather than a bug fix, but I am wondering whether this should be backported to WP 6.7.
I would view this more as a bug fix given the parent's width that should be being enforced hasn't been until now.
I don't hold strong opinions on whether this should be backported or not. Even if it is viewed as a bug fix, it's for a niche edge case and the bug isn't severe. I'd be fine with this landing in GB without backporting but happy if others feel differently.
You could always double check with the release leads.
This is testing as advertised for me.
Editor - Before | Editor - After |
---|---|
Frontend - Before | Frontend - After |
---|---|
@aaronrobertshaw Thanks for the review! I too believe this is an edge case, so I don't have a strong opinion on whether it should be backported to WP 6.7 or not. |
Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
This reverts commit 24d0930.
Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
Related to #63538
What?
This PR applies
box-sizing: border-box
to the Buttons block, so that its size when padding and background color are applied will match that of other blocks.Why?
As mentioned in #43465, I think this rule is necessary for
wp-block-
-based blocks that support padding.However, some users may prefer to fit the buttons inside to the container width instead of the wrapper block. Please let me know your thoughts.
Testing Instructions
Insert a Buttons block and apply padding, border and background color to it.
Screenshots or screencast
Below are screenshots of Twenty Twenty-Five:
Note
I consider adding
box-sizing
an enhancement rather than a bug fix, but I am wondering whether this should be backported to WP 6.7.By the way, Twenty Twenty-Five should not be affected by this change (Search results by
"<!-- wp:buttons"
).