-
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
Fix legacy button center alignments inside the buttons block #29281
Conversation
Size Change: +410 B (0%) Total Size: 1.38 MB
ℹ️ View Unchanged
|
Thanks for working on this. Before: After: The usual justifications work fine as well. It also appears that you've threaded the needle of not adding additional specificity to the rules for newly created blocks, well done.
It appears the primary problem with left and right alignments is that the container, Buttons, is now But for a non-migrated block, of course we can't really change that with CSS, because we don't know how to ambiguate between non migrated or not. But there's maybe a hack, probably best to explore separately: To convert that inspecting to CSS, this should work:
Since the data-align/left properties would not be present on new blocks, the CSS should be properly scoped to legacy blocks. The frontend should work fine. |
Thanks for the review and suggestions, @jasmussen. I think I'll try to tackle the left/right alignments separately. |
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 felt like a safe change to me, and addressed a good chunk of the issue. Thank you.
* Fix buttons > button alignments in the editor * Move style to the right place in stylesheet * Fix typo * Apply change in front-end too and adjust editor styles to match * Adjust margins * Add some more commentary
* Fix buttons > button alignments in the editor * Move style to the right place in stylesheet * Fix typo * Apply change in front-end too and adjust editor styles to match * Adjust margins * Add some more commentary
Description
Partly addresses #28957.
How this regression came about is a bit of a long story.
Before #26380, users could set their own alignment on button blocks inside the buttons container. #26380 removed the alignment options, but blocks still kept their visual alignments.
At a similar time #23168 made the buttons block a flex container. Individually aligned button blocks within buttons stopped working and there was no way to remove the alignments.
This change restores the visual appearance of center aligned button blocks within the buttons block.
I haven't been able to find a solution for left/right alignments (yet).
How has this been tested?
E2E tests are hard to implement, so no automated testing. Visual regression testing would be ideal for this issue.
Screenshots
Editor
Front end
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: