-
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 block: fix broken alignments in the editor #58114
Conversation
Size Change: -4 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
Flaky tests detected in 06356ab. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7624691744
|
/cc @carolinan |
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.
I don't recall why the <div>
was included for the user avatar but not the comments avatar, perhaps it was some sort of left over from the post author block. It doesn't look like this div was ever needed.
Even if extenders have targeted this div for any reason, which seems highly unlikely, and even though they would need to update their styles in that case, it is more important that the alignments work.
The alignment worked until WordPress 6.3, where the changes to the layout class names broke it. We need to test these type of changes more carefully.
(I suspect that the alignment issues with the latest post block may be for the same reason.)
it probably worked if the selector was different. Also, the extra div is not in the frontend (the alignments were only failing in the editor) so this one is safe to merge knowing theme specific CSS won't be affected unless it's specific for the editor |
What?
Closes #54714
Right alignments don't work in the editor (and presumably left alignments on RTL mode was broken too) for the avatar block
Why?
An extra div in the editor was causing the global alignment rules to not apply correctly:
body .is-layout-constrained > .alignright { float: right; }
was never working for the block
How?
I removed the extra div, I couldn't find a reason for it there, and it's been there since block creation
Testing Instructions
Insert the avatar block in the editor
Align it left right or center, it should work both in the editor and the frontend
Testing Instructions for Keyboard
Screenshots or screencast
Before:
After: