-
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
Search Block: Add support for setting the border radius #25553
Search Block: Add support for setting the border radius #25553
Conversation
When the button is placed inside and the inner elements have a matching border radius to the outer wrapper we get "thick" corners where it's a little out of sync. This smooths that out although is not a perfect solution.
ae85d6a
to
9c0b7ce
Compare
This tests well for me apart from the console warning mentioned. |
Thanks for the review @glendaviesnz I've made a few updates to address the issues highlighted if you wouldn't mind taking another look. |
👍 LGTM Probably a different PR, but might be good to get the Search button to match the front end styles in the editor like the standard button block does. |
Agreed. Some themes (e.g. TwentyTwenty) do not set the background for the wrapper when the button is positioned on the inside as well. Add this to not currently being able to take padding and border width into account for the border radius calculations and there is still a lot we can iterate on. Once Global Styles are in place we should be able to address a lot of this. |
I wonder if this should be added adhoc like the current PR or more as "Block support flag" to be able to auto enable it on several blocks (like we do now for lineHeight, colors, spacing support...). Do you think it's possible too try that approach separately in order to get a better understanding of the best approach here? |
Good idea. I'm more than happy to try out the suggested approach in a new PR. |
@youknowriad I've had a go at adding border radius block support in #25791 The PR has gotten a little large as I was updating the Search block to leverage the block support for border radius at the same time. If it would make it easier for people to review, I can split that PR into two. I think your suggested approach works out for the best, making border radius support available to any block that wants it. It didn't reduce the changes to the Search block greatly due to the additional work there to adjust inner elements' border radii so they were consistent with the outer border radius visually. All in all, the block support approach gets my vote. Any thoughts, suggestions or feedback is more than welcome 🙂 |
I think #25791 is a better way forward so would suggest we go with that approach if others agree. |
+1 on #25791 |
Great, I'll close this in favour of #25791 then. |
Description
This PR initially extended the work done in #25203 which has since been abandoned in favour of this.
Changes Included
"
character in the markup.Notes
innerBorderRadius = wrapperBorderRadius - wrapperPadding
Screencast
How has this been tested?
Manual Testing.
Testing Instructions
Screenshots
Types of changes
Enhancement.
Checklist: