Make WordPress Core

Opened 2 weeks ago

Last modified 2 weeks ago

#63276 new defect (bug)

Content width in block editor styles expects padding

Reported by: sergeykovalets's profile SergeyKovalets Owned by:
Milestone: 6.9 Priority: normal
Severity: normal Version: 5.0
Component: Bundled Theme Keywords: needs-patch
Focuses: ui, css Cc:

Description

When using the block editor, the content width while creating/editing a post is different from what is displayed after publishing on the site. When creating a post, I can't be sure how it will look once published.

If I use the classic editor, everything is fine — the way it looks while creating is exactly how it looks after publishing.

Change History (1)

#1 @sabernhardt
2 weeks ago

  • Focuses css added
  • Milestone changed from Awaiting Review to 6.9
  • Summary changed from Twenty Fourteen: Content width in block editor to Content width in block editor styles expects padding
  • Version changed from 6.7.2 to 5.0

All themes from Twenty Ten to Twenty Seventeen added 30 pixels to the width of .wp-block 'to account for padding' in [44152]. WordPress 5.4 removed that padding, but the number was already inaccurate with WP 5.0. (Left and right padding were set to 14 pixels for small screens, or 43 pixels each for larger screens.)

To accommodate older versions of WordPress, Twenty Fourteen probably could set the width like this in editor-blocks.css:

.wp-block {
	max-width: 474px;
}

.wp-block:where(.editor-post-title__block, .editor-block-list__block, .editor-default-block-appender) {
	max-width: 504px; /* account for padding in older WordPress versions */
}
Note: See TracTickets for help on using tickets.