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

Remove unnecessary empty Template Part wrapper div. #51296

Open
iamtakashi opened this issue Jun 7, 2023 · 0 comments
Open

Remove unnecessary empty Template Part wrapper div. #51296

iamtakashi opened this issue Jun 7, 2023 · 0 comments
Labels
[Block] Template Part Affects the Template Parts Block [Type] Enhancement A suggestion for improvement.

Comments

@iamtakashi
Copy link

Description

Let's say comments are in a template part. Even though the comments are turned off from a specific post/page, the div.wp-block-template-part is still in the markup. The height is 0 as it's empty, but the trouble is Gutenberg adds the default blockGap to the empty div, which sometimes creates misaligning.

For example, the content should be bottom aligned with the "design with WordPress" bit, but it won't because of the empty div with the default top margin added.

Screenshot 2023-06-07 at 14 20 53

I don't see the necessary to be there, can we stop adding it altogether?

Step-by-step reproduction instructions

  1. Make comments template part.
  2. Disable the comment from a post/page
  3. See the empty div.wp-block-template-part on the front of the site.

Screenshots, screen recording, code snippet

No response

Environment info

  • WP 6.2.2
  • Gutenberg trunk
  • Mac Chrome

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

@aurooba aurooba added [Type] Enhancement A suggestion for improvement. [Block] Template Part Affects the Template Parts Block labels Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Template Part Affects the Template Parts Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants