-
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
Site Title: Add border block support #63631
Conversation
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 working on this @akasunil 👍
This tests well for me.
Screen.Recording.2024-07-17.at.5.00.35.PM.mp4
The only thing I think we might need is the adoption of the box-sizing: border-box
for more consistent size/styling of the block. It seems like adoption of this is pretty inconsistent across blocks at the moment, so I'd like to get some second opinions.
…add/sitetitle-border-support
Size Change: +6.68 kB (+0.38%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
Thanks for the ping! Adding the border-box rule sounds consistent with other similar blocks, e.g. the post title block where it was introduced when padding support was added back in: #43457. The site title padding support was added way back in #31125 so has been around for a long time. Are there any concerns that adding box-sizing at this stage could affect sites out in the wild? If so, one option could be to guard the rule so it only applies if a border is present. That said, it feels more like a fix to me to add in the rule. I'll just ping @carolinan for visibility on this one as Carolina introduced padding for this block originally and might have thoughts on the matter. |
Agreed.
I think it would have to be a rather small edge case where the site title block is given an explicit width or inherits one from its parent only to have padding pushing its effective width wider. |
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 quick update making the border controls here optional 🚀
I've given this another test and all is working as expected. I've left one small nit as an inline comment. Once we tweak that, this is looking ready to me. Nice work 👍
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 is testing well for the adoption of border support 👍
✅ Global border styles apply correctly
✅ Block instance styles override global styles
✅ Box sizing takes into account border when parent enforces width
I restored the specificity for the inner link rule as the recent change in selector accidentally bumped it from 0-1-0
to 0-1-1
.
What?
Add border block support to the
Site Title
block.Part of #43247
Why?
Site Title
block is missing border support.How?
Adds the border block support in block.json
Testing Instructions
Site Title
block's border is configurable via Global StylesSite Title
block and Apply the border stylesScreenshots or screencast
In backend:
In frontend: