-
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
Avatar: Fix application of borders #47630
Conversation
Size Change: +515 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
Flaky tests detected in 83686bb. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4070517212
|
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.
Thank you for taking the time to test this so thoroughly and submitting the fix 🦸
It works well for me.
For anyone testing Twenty Twenty, you must set a border style, but it is a theme issue.
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.
Nice one, logic looks good and this is testing well for me:
✅ Avatar block with uniform sides is output correctly in post editor and on site frontend
✅ Avatar block with non-uniform sides is output correctly in post editor and on site frontend
✅ Tested in a blocks-theme and with TwentyTwenty theme with appearance tools enabled
Only issue I noticed is that I think there's a no-longer-needed call to safecss_filter_attr, but other than that this LGTM ✨ — good idea splitting the logic into a separate utility function, it helps the readability 👍
Fixes: #47408
What?
Ensures border classes and styles are correctly applied to the avatar block's markup.
Note: The original issue notes this as an issue for classic themes however it should be a problem for block themes as well.
Why?
The avatar block adopts border supports and skips the serialization of the support classes and styles so they can be applied to an inner image element. Given the block skips serialization it must handle the application of all border configurations and it is currently missing the handling of split or "individual" borders.
How?
box-sizing: border-box
reset to the block'simg
element so borders don't break out of the avatar's sizing.Testing Instructions
Screenshots or screencast
Screen.Recording.2023-02-01.at.5.50.01.pm.mp4
Screen.Recording.2023-02-01.at.6.05.35.pm.mp4