-
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
Add ability to add padding to certain blocks #15084
Comments
Adding a background actually adds padding by default. when it comes to the possibility to tweak these paddings, that might be something to consider and this is a duplicate of #14747 |
Adding a background to the Groups block does NOT add padding by default. It does when adding a background to a paragraph block. |
@RobinRoelofsen It might a theme conflict or something, I just made a Gif showing that the group block adds padding. In this example I have a paragraph block within a group block. Both have backgrounds and paddings. |
@youknowriad Yes, it does because you add a background to the paragraph block as well. When I create a group block with a background color, I would not expect to also add a background color to the blocks I add to the group block. Is that a wrong assumption? |
It does no matter the content of the group block, as soon as you add the background to the group block, a padding is added, that's the current behavior. |
Shoot, trying it with Twenty Nineteen and it does! Not with GeneratePress, though. Please accept my apologies. I guess I am too 'forward' using the Gutenberg plugin with a block that's not officially out yet... |
Thanks, no apologies needed and very happy you're using the plugin and providing feedback. That's what help us find bugs and iterate before hitting Core. |
Busy writing a WP guide including an extensive look into the block editor. That's why I am using the latest version, so I'm always up to date ;-) |
That's not something built into Gutenberg. That's a theme-specific style added to Twenty Nineteen and, presumably, other core themes. The following is from the Twenty Nineteen stylesheet:
The Gutenberg The Gutenberg |
In WP v6.0.1 I noticed that padding is only applied when the group style was changed from the default 'column' style to 'cover'. I had created the group and moved a shortcode block into that group. When I tried returning the group style to 'column' it added another group. I retested creating a group and adding a paragraph block, no padding was applied and no theme conflict evident in Inspector. The default style this time was 'cover', but I had to click 'cover' before the padding was applied. |
Love the new group block! Just noticed that adding a background color doesn't add padding to the block as it does when adding a background color to a paragraph block.
I solved it for my situation by adding these lines to my CSS:
I understand that adding padding is not always desirable when using the group block, since the items often need to line up with the rest of the block.
Proposed solution: add padding boxes to the block settings sidebar for both the group block and the paragraph block, so the user can set their own preferred padding when applicable.
The text was updated successfully, but these errors were encountered: