Make WordPress Core

Opened 3 years ago

Last modified 3 weeks ago

#59957 new defect (bug)

Twenty Twenty and Twenty Twenty-One: Details block padding issue when setting its alignment to full-width

Reported by: viralsampat Owned by:
Priority: normal Milestone: Awaiting Review
Component: Bundled Theme Version: 6.3
Severity: normal Keywords: has-patch
Cc: Focuses: css

Description

Hello Team,

I have worked on the "Twenty Twenty" theme and found that the "Twenty Twenty" theme contains an issue for the "Details" block. The padding is not displaying properly on the back-end side. The front-end side looks good. When we set "Full Width" from the components toolbar group

Here, I have provided screenshots:

Front-end:

https://share.cleanshot.com/5lDkjpfwVVwwxFRlNvwl

Back-end:
https://share.cleanshot.com/zdf5SNvpv7kzrHRL9F8N

Thanks,

Attachments (1)

59957.patch​ (1.6 KB ) - added by nidhidhandhukiya 3 years ago.
This issue is happening with Twenty twenty and twenty twenty one also I have applied the patch which can resolve the issue for both the themes.

Download all attachments as: .zip

Change History (6)

@nidhidhandhukiya
3 years ago

This issue is happening with Twenty twenty and twenty twenty one also I have applied the patch which can resolve the issue for both the themes.

#1 @sabernhardt
3 years ago

  • Component Themes → Bundled Theme
  • Keywords dev-feedback removed
  • Summary Twenty Twenty Theme: Details block padding issue when setting its alignment to full-width → Twenty Twenty and Twenty Twenty-One: Details block padding issue when setting its alignment to full-width

The max-width would need to be changed, not the margins.

I think this would work for both themes (in editor styles):

.wp-block-details > .wp-block {
	max-width: 100%;
}

#2 @sabernhardt
3 years ago

  • Version 6.4 → 6.3

#3 @sabernhardt
22 months ago

#62890 was marked as a duplicate.

#4 @karmatosed
3 weeks ago

  • Keywords needs-refresh added; needs-patch removed

Goodness this has sat for a little while, let's see what we can do about getting this moving. To summarise. The front end is already right for this theme. In the editor, a full-width Details block stays narrow.

I would suggst what is needed, would be a fix to the max-width in the editor styles for Twenty Twenty and Twenty Twenty-One. Do not change the margins, and do not change the front end. The current patch needs to be redone as a result of this to get that resolved.

This ticket was mentioned in ​PR #14738 on ​WordPress/wordpress-develop by ​@irozum.


3 weeks ago
#5

  • Keywords has-patch added; needs-refresh removed

Summary

In the block editor, a Details block set to full width stays at the narrow content width in Twenty Twenty and Twenty Twenty-One, while the front end is already correct.

The generic .wp-block { max-width: ... } editor rule also constrains the children of the Details block. This adds .wp-block-details > .wp-block { max-width: 100%; } to the editor styles of both themes, as suggested in the ticket. Margins and front-end styles are untouched.

  • Twenty Twenty: editor-style-block.css and its RTL counterpart.
  • Twenty Twenty-One: new details/_editor.scss partial imported in blocks-editor.scss, plus the compiled style-editor.css.

Testing instructions

  1. Use Twenty Twenty or Twenty Twenty-One and add a Details block with some content in the editor.
  2. Set its alignment to Full width.
  3. Before: the block stays narrow in the editor. After: it fills the full width, matching the front end.

CSS-only change, so there is no automated test. I did not run a browser check of the editor.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Sonnet 5.5
Used for: Implementation and PR description.

---

This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

Note: See TracTickets for help on using tickets.