-
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
Grid Block layout issues with Twenty Twenty-One #63300
Comments
Trac ticket: |
I think that the PR @up1512001 opened is the right approach. I can only reproduce this when using the GB plugin - 18.7.1 (testing with 6.6-RC3-58701) and trunk (testing with 6.5.5). I can't reproduce it on WP6.5 or WP6.6 alone. This is happening because of the TT1 styles that @up1512001 mentions, in combination with a difference in html output when GB is enabled vs disabled - which is why this isn't always reproducible. GB enabled markup(excess newlines removed) <div class="wp-block-group is-layout-grid wp-container-core-group-is-layout-1 wp-block-group-is-layout-grid">
<p>First cell</p>
<p>Second cell</p>
<p>Third cell</p>
</div> Vanilla markup(excess newlines removed)
The way this works in TT1 on a vanilla site is that the outer div - The problem doesn't exist if I remove the grid check in this line This early return was added by @tellthemachines in #49387 and it was judged " it's up to themes to update their styles if they want to support new features, so I don't think it's a huge issue" |
Thanks for the ping! This made me realise that #49387 was never synced to core when the grid layout was stabilised, which it should have! So the broken behaviour you're seeing with Gutenberg enabled would also be happening in core if that PR had been synced. I agree a code update in TT1 is the best way to fix it, but not 100% sure how - might be good to get someone who knows the theme well to review the proposed fix. Maybe @karmatosed ? I also notice that in 6.6, due to the inner wrapper not being removed, some grid children aren't stretching the full width of their grid cell because of conflicting styles applied to the inner wrapper. So we get this: Where really the blocks should look like this: (ignore the different background colors, I was testing customizer styles which don't apply in the editor 😅 ) I'll get a core sync PR for #49387 ready. Might be good to try and get it into 6.6.1, cc @ellatrix |
Quick follow-up on this: the sync of #49387 has now been committed to core trunk. |
The upstream TT1 changes to fix the issue have been merged |
I re-tested this and I can confirm it is fixed. Thank you all! |
Description
The Grid block has some layout issues when used with Twenty Twenty-One.
The editor looks good:
...but the layout in the published post is broken:
Depending on the details, if the issue is coming from the theme, this would need to be moved to Trac (it is a bundled theme).
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: