Make WordPress Core

Opened 2 years ago

Last modified 8 months ago

#59706 new defect (bug)

Twenty Twenty: Latest Posts block colors and padding

Reported by: viralsampat's profile viralsampat Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.3.2
Component: Bundled Theme Keywords: dev-feedback changes-requested has-patch
Focuses: css Cc:

Description

Hello Team,

I have worked on the "Twenty Twenty" theme and found that the "Twenty Twenty" theme contains an issue for the "Latest Post" block. The text color does not change when we try to select text color from block settings.

Also, When we select the background color, the padding is added in admin, But in the front end, the post text displays a sticky, The padding is not added for the front end.

Here, I have provided the issue video:

Issue: https://share.cleanshot.com/5mkR0sVQ25VYM6xp434Y

Thanks,

Attachments (5)

59706.patch (827 bytes) - added by viralsampat 2 years ago.
I have checked above mentioned issue and I have resolved it and added patch. Also, I have attached screenshot after resolved this issue.
59706.2.patch (1.2 KB) - added by viralsampat 2 years ago.
I have checked above mentioned issue and I have resolved it and added patch. Also, I have attached screenshot after resolved this issue.
latest_post_text_color_issue_backend.png (316.2 KB) - added by viralsampat 2 years ago.
latest_post_text_color_issue_frontend.png (269.9 KB) - added by viralsampat 2 years ago.
2020-latest-posts-colors-6.4.png (64.2 KB) - added by sabernhardt 2 years ago.
Latest Posts block in WordPress 6.4-RC1, with Accent text color (custom green) and Subtle Background background color

Download all attachments as: .zip

Change History (10)

@viralsampat
2 years ago

I have checked above mentioned issue and I have resolved it and added patch. Also, I have attached screenshot after resolved this issue.

@viralsampat
2 years ago

I have checked above mentioned issue and I have resolved it and added patch. Also, I have attached screenshot after resolved this issue.

@sabernhardt
2 years ago

Latest Posts block in WordPress 6.4-RC1, with Accent text color (custom green) and Subtle Background background color

#1 @sabernhardt
2 years ago

  • Component changed from General to Bundled Theme
  • Focuses css added
  • Summary changed from Twenty Twenty theme has issue for Latest Posts block. to Twenty Twenty: Latest Posts block colors and padding

WordPress 6.4 adds the chosen text color to the link (only), but the rest of the text remains the theme's color selections. When adding support for color controls, the theme's colors still need to apply for users do not select a color. (Replacing a specific color with inherit would change how existing blocks appear.)

The block-library styles define a padding for blocks with a background color and the left padding of zero, so that would not be exclusive to Twenty Twenty.

#2 @sabernhardt
19 months ago

#61524 was marked as a duplicate.

#3 @karmatosed
19 months ago

  • Keywords changes-requested added

#4 @shubhtoy
8 months ago

Is this issue still open?
I would love to work on this.

This ticket was mentioned in PR #9057 on WordPress/wordpress-develop by @sandeepdahiya.


8 months ago
#5

  • Keywords has-patch added; needs-patch removed

Trac ticket: https://core.trac.wordpress.org/ticket/59706

This patch ensures that in twenty-twenty theme -

In the block-editor:

  1. the Latest Posts, Latest comments, Categories, Categories List blocks correctly apply the user-defined text color (has-text-color) in the block editor. Previously, hardcoded default styles (color: #6d6d6d) prevented selected text colors from rendering. This fix allows color: inherit when .has-text-color is present.
  2. When users choose a custom text color for the Latest Comments and Latest Posts blocks, the <time> elements (post or comment dates) also reflect that color in the block editor. Without this, only links or titles change color while dates retain the default.

In the frontend:

  1. The Latest Posts and Latest comments blocks correctly apply the user-defined text color (has-text-color) in the front end. Without this, only links or titles change color while dates retain the default. Since Categories, and Categories List blocks already have <a> links so they reflect color changes by default.
  2. In the frontend - Latest Posts and Latest comments blocks, the post and comment dates also reflect the user-defined color.

Before patch - Latest posts block in backend and front end
https://github.com/user-attachments/assets/1d975eb8-645c-4b65-93ef-e909dc409398

After patch - Latest posts block in backend and front end
https://github.com/user-attachments/assets/76d7bfd0-2b12-4f94-bbd3-cad0593df695

Before patch - Latest comment block in backend and front end
https://github.com/user-attachments/assets/a69a3bc7-c502-4c92-bf9a-8829ed6ad94e

After patch - Latest comment block in backend and front end
https://github.com/user-attachments/assets/fb725823-88ec-4b2e-8faf-b85461fc4acc

Test steps in the WordPress admin : -

Go to /wp-admin/ → activate twenty-twenty theme → create or edit a post.
Insert a Latest Posts or Latest comments block.
Set a custom text color.
Preview/save and verify the color is applied correctly on:

Editor side (backend)
Front end of the site

Since padding is defined by block-library styles, so not changing that.

Note: See TracTickets for help on using tickets.