Skip to content

Post Comments Form: Elements in the block don't respect block gap#68955

Open
dhananjaykuber wants to merge 2 commits intoWordPress:trunkfrom
dhananjaykuber:fix/post-comments-form-block-gap
Open

Post Comments Form: Elements in the block don't respect block gap#68955
dhananjaykuber wants to merge 2 commits intoWordPress:trunkfrom
dhananjaykuber:fix/post-comments-form-block-gap

Conversation

@dhananjaykuber
Copy link
Copy Markdown
Contributor

Fixes #53690

What?

Adds proper block gap spacing to elements within the Post Comments Form block to maintain consistent vertical rhythm with the rest of the site.

Why?

Currently, the elements in the Post Comments Form block use browser default margins, which don't align with WordPress's block spacing system. This creates an inconsistent visual rhythm where form elements don't match the spacing used throughout the rest of the site.

How?

  1. Added a container div with class wp-block-post-comments-form-elements to wrap form elements
  2. Applied var(--wp--style--block-gap) spacing through CSS to maintain consistent gaps between form elements
  3. Removed default browser margins from paragraphs within the form to prevent spacing conflicts

Testing Instructions

  1. Open a post or page where comments are enabled
  2. Add a Post Comments Form block
  3. Verify that the spacing between form elements (comment textarea, name field, email field, etc.) matches the block gap spacing used in other blocks

Screenshots or screencast

Before

Screenshot 2025-01-30 at 11 26 17 AM

After

Screenshot 2025-01-30 at 11 25 50 AM

@github-actions
Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: dhananjaykuber <dhananjaykuber@git.wordpress.org>
Co-authored-by: jordesign <jordesign@git.wordpress.org>
Co-authored-by: iamtakashi <iamtakashi@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Block] Comments Form Affects the Comments Form Block labels Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Comments Form Affects the Comments Form Block [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Post Comments Form: Elements in the block don't respect block gap

2 participants