Post Comments: Even out the top margin inside the block#35887
Conversation
|
Size Change: +2.53 kB (0%) Total Size: 1.07 MB
ℹ️ View Unchanged
|
|
I think this is a great idea to simplify the spacing in this area. I've tried this out on Blockbase + Co, and as far as I can see, it doesn't make a massive difference. In Blockbase, we've hidden the So, this looks good to me from my testing 👍 |
| @@ -1,4 +1,9 @@ | |||
| .wp-block-post-comments { | |||
| .comment-reply-title, | |||
| .nocomments { | |||
There was a problem hiding this comment.
If #35743 merges, I don't think .nocomments will ever appear. That said, I think zero'ing the margin for the reply title is an improvement.
Also I tested this PR and 2022, if I go to a post with existing comments and comments turned off, this is what appears:
I thought maybe the "Comments are closed" message would appear, but it does not.
There was a problem hiding this comment.
Ah, good catch. I updated the PR to just target the first h3 in there instead.


Depending on whether or not comments are open or closed, the first block within the
.comment-responddiv either has a whole lot of top margin, or very little:Gutenberg doesn't define those margins — they're left at the browser defaults. This discrepancy makes it impossible for themes to set a consistent vertical position for the post comments block, without adding custom CSS:
This PR removes the top margin from those top items, to allow these titles to even out by default:
The
wp-commentsblock still has its own native block margins, so I don't think these are really necessary anyway. I don't think this should have a substantial effect on any existing block themes.