Skip to content
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

Blockbase: Inconsistent vertical margin for group block #5643

Closed
iamtakashi opened this issue Mar 9, 2022 · 4 comments
Closed

Blockbase: Inconsistent vertical margin for group block #5643

iamtakashi opened this issue Mar 9, 2022 · 4 comments
Labels
[Theme] Blockbase [Type] Bug Something isn't working

Comments

@iamtakashi
Copy link
Contributor

iamtakashi commented Mar 9, 2022

Steps to replicate

  • Add a few group blocks
  • Add some paragraphs inside the group blocks
  • Bonus: Add a border to each group block to help to see the issue
  • Copy all the group blocks and put them in a column block
<!-- wp:heading {"style":{"spacing":{"margin":{"top":"0px"}}}} -->
<h2 style="margin-top:0px">Menu</h2>
<!-- /wp:heading -->

<!-- wp:group {"style":{"border":{"width":"1px"}},"borderColor":"vivid-red"} -->
<div class="wp-block-group has-border-color has-vivid-red-border-color" style="border-width:1px"><!-- wp:paragraph -->
<p><strong>Chicken Sandwich</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Cajun chicken breast with lettuce and tomato on a freshly toasted bun.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>$8.00</strong></p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:group {"style":{"border":{"width":"1px"}},"borderColor":"vivid-red"} -->
<div class="wp-block-group has-border-color has-vivid-red-border-color" style="border-width:1px"><!-- wp:paragraph -->
<p><strong>Veggie Burger</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>A delicious, soy, boca patty, served on a freshly toasted, whole-wheat bun.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>$8.00</strong></p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:group {"style":{"border":{"width":"1px"}},"borderColor":"vivid-red"} -->
<div class="wp-block-group has-border-color has-vivid-red-border-color" style="border-width:1px"><!-- wp:paragraph -->
<p><strong>Awesome Burger</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The burger that made us famous. 100% pure lean beef grilled to perfection.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>$8.00</strong></p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:columns {"align":"wide"} -->
<div class="wp-block-columns alignwide"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:image {"id":150,"sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="https://patternboilerplates.files.wordpress.com/2022/03/max-van-den-oetelaar-t3urjucymg-unsplash-landscape-portrait.jpg?w=683" alt="" class="wp-image-150"/></figure>
<!-- /wp:image --></div>
<!-- /wp:column -->

<!-- wp:column -->
<div class="wp-block-column"><!-- wp:heading {"style":{"spacing":{"margin":{"top":"0px"}}}} -->
<h2 style="margin-top:0px">Menu inside a column</h2>
<!-- /wp:heading -->

<!-- wp:group {"style":{"border":{"width":"1px"}},"borderColor":"vivid-red"} -->
<div class="wp-block-group has-border-color has-vivid-red-border-color" style="border-width:1px"><!-- wp:paragraph -->
<p><strong>Chicken Sandwich</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"left"} -->
<p class="has-text-align-left">Cajun chicken breast with lettuce and tomato on a freshly toasted bun.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>$8.00</strong></p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:group {"style":{"border":{"width":"1px"}},"borderColor":"vivid-red"} -->
<div class="wp-block-group has-border-color has-vivid-red-border-color" style="border-width:1px"><!-- wp:paragraph -->
<p><strong>Veggie Burger</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>A delicious, soy, boca patty, served on a freshly toasted, whole-wheat bun.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>$8.00</strong></p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:group {"style":{"border":{"width":"1px"}},"borderColor":"vivid-red"} -->
<div class="wp-block-group has-border-color has-vivid-red-border-color" style="border-width:1px"><!-- wp:paragraph -->
<p><strong>Awesome Burger</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The burger that made us famous. 100% pure lean beef grilled to perfection.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>$8.00</strong></p>
<!-- /wp:paragraph --></div>
<!-- /wp:group --></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->

Result

The group blocks inside a column block don't have any gap between them. This is seen in both the editor and the front of the site.

screencapture-iamtakashi-wordpress-2022-03-09-group-blocks-2022-03-09-15_48_09

screencapture-wordpress-post-iamtakashi-wordpress-com-12800-2022-03-09-15_47_48

Expected

Consistent behaviour regardless of where the group blocks are.

TT2 also has the same issue, and it's probably better to be standardised in the plugin. If I imagine themes do different things about that, it can get very messy. If this needs to be reported in the plugin, let me know and feel free to close this.

@mikachan mikachan added [Theme] Blockbase [Type] Bug Something isn't working labels Mar 10, 2022
@pbking
Copy link
Contributor

pbking commented Mar 10, 2022

I see that the margin-top: var( --wp--style--block-gap ); that should be present for children of the column is missing. It seems to be applied to the wp-block-columns element (the parent containing the columns) but not the wp-block-column elements themselves.

This is a gap in the Gutenberg plugin (pun intended) and should be addressed there.

@iamtakashi
Copy link
Contributor Author

@pbking Thanks for confirming! I'll report this there.

@iamtakashi
Copy link
Contributor Author

iamtakashi commented Mar 15, 2022

After reporting this in the Gutenberg repo, it turned out an issue with Blockbase and Twenty Twenty-Two. I can confirm the issue is not happening with Twenty Twenty-one.

Screenshot 2022-03-15 at 14 42 14

I'll report the issue in Trac for TT2, but I'll also reopen this as a Blockbase issue. let me know if there is anything that I can help.

@iamtakashi iamtakashi reopened this Mar 15, 2022
@iamtakashi
Copy link
Contributor Author

Spoke too soon. I can't now reproduce the issue with TT2 or Blockbase. I'm not entirely sure what has happened but it's all good now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Theme] Blockbase [Type] Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants