-
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
Button Block: Backwards compatibility floating doesn’t work properly #21685
Comments
I've been doing some tests here, and it seems to me that this is more related to the usage of "lightBlockWrapper" on the button block than the markup change itself. It seems to me that "lightBlockWrapper" on a button doesn't work with alignments. I believe it was missed that the button block could have alignment for old content. cc @ellatrix |
That said, on frontend, it seems good for me maybe aside the "center" alignment. |
Gotcha. Will wait to see what the path forward is regarding the editor :-) And good point about the frontend working with the default Gutenberg frontend styles. The theme im testing with overrides the default frontend floating rules that comes with Gutenberg, so it might not be as much of a disruption on the frontend for every site. |
This isn't specifically related to floating, however I think I've encountered another styling regression in a particular theme (in this case Barnsbury, logged in Automattic/themes#1929) where there is now an additional grey outline around a button container (legacy markup). The issue is that the block container is being rendered with a grey border, which seems consistent with the change in #21642, so I thought I'd mention it here, too. Sample content
|
Hm, strange that the light wrapper was added to the button block, but not to the buttons blocks. I recall looking at implementing the light block wrapper for these, but not going through with it because of some color and alignment issues. |
Related: woocommerce/storefront#1335 |
The recent changes to Button Block markup in 7.9.1 has caused a backward compatibility issue for buttons created well before 7.9. I have a testing post that lists the Button Block with all of its possible options. I created this post many months ago and I’m not sure which version of Gutenberg I had at the time.
After updating to 7.9.1 the
.wp-block-button
wrapper gets removed on those older buttons leaving the alignment class a direct child of the content wrapper in the markup like this:.entry-content > wp-block-button.alignleft.wp-block-button__link
.I expected to get something like this which is what new buttons created after 7.9.1 give you:
.entry-content > .wp-block-buttons.alignleft > .wp-block-button__link
.Steps to reproduce the behavior:
Expected behavior
Before 7.9.1, Button blocks came with a
.wp-block-button
wrapper in the markup. After 7.9.1, newly created buttons get a.wp-block-buttons
(with an “s”) wrapper but both of them are missing from these “legacy” button blocks I created a while ago.I can fix this with some very specific CSS but ideally, “legacy“ Buttons should also get wrapped in
.wp-block-button
or.wp-block-buttons
markup to prevent disruption on sites that have older Gutenberg content.Lastly, this issue effects both the frontend and in the editor backend the same way. I’m wondering if its possible to have Gutenberg re-render those “legacy” buttons to include the wrappers like it did before.
Editor version (please complete the following information):
Desktop (please complete the following information):
Sample content
The text was updated successfully, but these errors were encountered: