-
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
Group block with .alignfull.has-global-padding
does not actually have global padding
#48751
Comments
I can reproduce this in 6.11 and 6.2 RC. The padding with the custom property is overridden and set to 0, which makes the final margin calculation incorrect.
|
@tellthemachines Where can we even start to try to troubleshoot this CSS issue? |
I can reproduce the issue, but as far as I can tell it's working as expected 😅 To clarify: the logic behind how the global padding is applied can be read in full here but the gist of it is that if there are two or more nested blocks with In retrospect, perhaps In any case, I'll have another look at the rules as this feels like a reasonable use case that should work. |
Because the spacing was removed from the query, themers are pretty much forced to nest the group blocks. |
Wait which spacing is this? It's hard to keep up with all the changes 😅 |
It is! For larger screens you can have default width text and and full width media if you enable "Inner blocks use content width" on the post content block but it doesn't help on small widths, where the paragraph, headings etc will touch the edges. |
Hmm, that shouldn't be necessary as root level blocks are full width by default. The Group should only be needed if we want them to be wide width or content width, or as you mention if we want them to have root padding on small viewports. But for a block like Post Content, we really want its children to have root padding, not the block itself, so it could be right at the root level. Or am I missing something? |
Create a post with one default, wide and full-width group with some text, and for the sake of testing, a full-width image. The full-width blocks are not full-width. This is the resulting margins on the full width group in the post, when viewed as part of the query loop, on the front:
Even removing the |
Aside: I know this is going to sound incredibly stupid but it is actually not clear that root level blocks are full width by default, because it doesn't have the full-width indicator -the alignment button, in black, in the toolbar. |
I can only reproduce this is the Query block is set to "Inner blocks uses content width", otherwise the Post Template doesn't have an alignment control and takes up full width by default.
That doesn't sound stupid at all! I agree it's a pretty unintuitive UI. Even for folks who know HTML and CSS it's not immediately obvious that by default everything is full width because it's unstyled. It would be good to have some clear indication of what the actual block width is at any time, though I'm not sure what the best way to approach this may be. If the existing alignment control were to display only the full width button, with no ability to change it, would that convey clearly enough that the block is full width by default? There should probably be a separate issue to discuss the options here. |
I am just getting more and more confused. The query that I have at the root level has the class |
Even if it has the
This sounds like a bug! I can only reproduce it partially: the class is removed in the editor but stays on the front end. |
Description
As I was rebuilding my site using Twenty Twenty-Three, I ran into this bug.
When you create a
core/group
block that also has.alignfull
, it may lack the padding, as the.alignfull
padding reset overrides it.Step-by-step reproduction instructions
core/group
block inside it at the top level and make italignfull
.core/group
block.You will notice that there is no padding on the
core/group
block even though it has thehas-global-padding
class, and that leads to the paragraph content touching the edges of the browser viewport when using a narrow viewport.I have recreated it on this InstaWP site.
Screenshots, screen recording, code snippet
Environment info
No response
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: