-
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
Remove inner wrapper for grid Groups in classic themes #49387
Conversation
Size Change: +3 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
Flaky tests detected in b8d6a38. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4537707599
|
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.
Glad my mistake could help unearth other issues to address! 😄
The code change looks good, and I think we should skip the inner wrapper for grid layout types 👍
In terms of how Grid is functioning in Classic themes, though, I ran into a couple of issues with both TwentyTwentyOne and TwentyTwenty themes due to them including styling rules that don't play nicely with how Grid behaves. I'm also curious that I didn't manage to recreate your screenshot so I very well could be missing something in my testing environment 🤔
Here are a couple of examples:
In TwentyTwentyOne, ::before
and ::after
psuedo-elements appear to be added to the group block, which means that the grid treats these as elements within the grid. Here's how it looks with an empty space added to the beginning of the grid:
TwentyTwenty doesn't have that issue, but for some reason the items within the grid don't appear to be holding their shape. I couldn't quite work out what's going on there:
At any rate, these issues are separate from whether or not to remove the inner wrapper so not a blocker for this PR. Also, since Grid is experimental we can keep playing around with what the behaviour should be in Classic themes separately (e.g. whether we should include a default block gap value as in flex, or if grid causes too many issues, explore whether the grid variation should be hidden from Classic themes altogether).
LGTM!
Thanks for testing! My screenshot is the editor view, which doesn't have those pseudo-elements. The front end looks like: In TwentyTwenty I think the issue is the padding on paragraphs with background color: Ultimately 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. Also, once we have theme.json support for enabling and disabling layout in blocks themes will have more control over that aspect 🙂 |
Ah, of course, yes, the padding is pretty intense in that theme 😄
Agreed, and the enabling/disabling will be great for themes that aren't quite ready for the new features yet 👍 |
What?
In testing #49385 I realised that #49018 didn't take into account the Group block's inner wrapper in classic themes. This PR removes the inner wrapper for Groups with grid layout, similarly to what's done with flex layouts.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast