Make WordPress Core

Opened 13 months ago

Last modified 8 months ago

#55744 new defect (bug)

Twenty Twenty: comments form margins do not work with Post Comments Form block

Reported by: kajalgohel's profile kajalgohel Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.0
Component: Bundled Theme Keywords: has-patch needs-testing close
Focuses: ui, css Cc:

Description

When we select Post Comments Form block in post or page, the design is not proper in front-side.

For better understanding I provide video attachment.

Attachments (6)

Twenty-twenty Theme.mp4 (7.7 MB) - added by kajalgohel 13 months ago.
#55744.diff (429 bytes) - added by kajalgohel 13 months ago.
patch added
55744.1.patch (445 bytes) - added by nidhidhandhukiya 12 months ago.
According to me the spacing should same as the other theem so it follows consistency. In my patch i am trying to give solution similar to the other themes.
55744.2.patch (1.7 KB) - added by sabernhardt 12 months ago.
multiple selectors for heading styles
55744.3.patch (1.7 KB) - added by multidots1896 11 months ago.
added patch
post-comment-block-form-before.png (128.9 KB) - added by sabernhardt 10 months ago.
screenshot showing both (duplicate) copies of the form: the Post Comments Form block and the one in Twenty Twenty's template (without any patch)

Change History (10)

@kajalgohel
13 months ago

patch added

#1 @kajalgohel
13 months ago

  • Keywords has-patch needs-testing added; needs-patch removed

@nidhidhandhukiya
12 months ago

According to me the spacing should same as the other theem so it follows consistency. In my patch i am trying to give solution similar to the other themes.

@sabernhardt
12 months ago

multiple selectors for heading styles

#2 @sabernhardt
12 months ago

Thanks for the report and patches!

The post comments form block's heading styles are more specific than Twenty Twenty's.

.wp-block-post-comments-form .comment-reply-title {
	margin-bottom: 0;
}

Using negative values may not have been the best way to set these margins in the first version of the theme. If the margin increases, however, the bottom margin of the heading would need to be set to zero in the theme so it does not change the spacing for the standard (non-block) comment form.

Adding !important can override styles that the user defined, either in a child theme or in Additional CSS.

For another option, I suggest adding a more specific selector without replacing the original selector.

.comment-reply-title,
.wp-block-post-comments-form .comment-reply-title {

On the other hand, this block is designed for full-site editing and the theme was not. When I add the block to a post that enables comments, I still have the comment form added by the template. Then I have a duplicate form with duplicate IDs.

@multidots1896
11 months ago

added patch

@sabernhardt
10 months ago

screenshot showing both (duplicate) copies of the form: the Post Comments Form block and the one in Twenty Twenty's template (without any patch)

#3 @sabernhardt
10 months ago

  • Keywords close added
  • Summary changed from Twenty Twenty Theme : Post Comments Form block design issue in 6.0 RC2 to Twenty Twenty: comments form margins do not work with Post Comments Form block
  • Version set to 6.0

No, I recommend closing this ticket without changing the theme stylesheets. This is an editor bug because it allows people to add this block in 'classic' themes, within the post editor, even after GB28744 excluded comments-related blocks from classic themes.

Creating a second copy of the form causes invalid, duplicate ID attributes, which can make both forms more difficult to use. At least Twenty Twenty's broken styles should effectively discourage anyone from using this block in the theme.

Theoretically a child theme could adjust the template. However, if someone wants to remove the template's form and add the block to each post, revising the margins for that site would be a small additional task.

#4 @sabernhardt
8 months ago

#56676 was marked as a duplicate.

Note: See TracTickets for help on using tickets.