[wp-trac] [WordPress Trac] #62243: Twenty Twenty: Latest post block there is no space between post-author/post-date and post content on the front-end.
WordPress Trac
noreply at wordpress.org
Thu Nov 21 22:08:41 UTC 2024
#62243: Twenty Twenty: Latest post block there is no space between post-author
/post-date and post content on the front-end.
-------------------------------------+------------------------------
Reporter: viralsampat | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bundled Theme | Version:
Severity: minor | Resolution:
Keywords: needs-testing has-patch | Focuses: css
-------------------------------------+------------------------------
Changes (by sabernhardt):
* keywords: needs-patch needs-testing reporter-feedback => needs-testing
has-patch
* severity: normal => minor
Comment:
The lack of space can occur when
1. the Latest Posts block is set to show "Full post" and
2. the first element/block in the post is a paragraph.
The excerpt option has a small margin from block styles (GB15722), but
#47340 added a margin for the full post option in Twenty Nineteen and
[https://github.com/WordPress/twentytwentyone/pull/153 PR 153] set the
same top margin for both options in Twenty Twenty-One.
In Twenty Twenty, paragraphs have zero top margin. In contrast, a heading
as the first block can have a top margin of `3.5rem` or more, and the
Image block has a `4rem` margin.
Patch notes:
- If the selector targets the paragraph element, it needs to apply only
when that paragraph is at the beginning of the post.
[attachment:"62243.1.patch"] uses `.wp-block-latest-posts__post-full-
content > p:first-child`.
- Targeting the `.wp-block-latest-posts__post-full-content` div is another
option. It would give a minimum margin above the post content, and I did
not notice that rule increasing the space when the first inner block has
its own margin.
- If this were the newest theme, I would suggest giving the `:first-child`
a consistent margin regardless of the element. However, five years later,
I would prefer to keep any changes minimal.
- The `.entry-content` class (62243.patch) would apply styles only within
page/post content, and the Latest Posts block is intended for the Widgets
area(s).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62243#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list