Skip to content

Adding padding to the body in theme.json adds scrollbar to the style variation preview #43572

@carolinan

Description

@carolinan

Description

When theme.json adds padding to the body (spacing.padding), the padding is visible in the style variation preview in the global styles sidebar.

Step-by-step reproduction instructions

  1. Activate Twenty Twenty-Three
  2. In theme.json, add padding to the body (see example below)
  3. Open the Site Editor and the styles sidebar

Screenshots, screen recording, code snippet

100px top padding:

		"spacing": {
			"blockGap": "1.5rem",
			"padding": {
				"top": "100px",
				"right": "var(--wp--preset--spacing--30)",
				"bottom": "0px",
				"left": "var(--wp--preset--spacing--30)"
			}
		},

The style variation in the styles sidebar has a scrollbar and does not show the lettering example or colors.
And on browse styles:
The browse styles panel preview also shows the padding

Environment info

WordPress 6.0.1
Gutenberg trunk

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

Labels

Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Type] BugAn existing feature does not function as intended

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions