Skip to content

[Site Editor] Spacing values declared as variable have no effect in the site editor. #43042

@Gierand

Description

@Gierand

Description

When we add variable values to the spacing in the theme.json file, no change occurs.

Step-by-step reproduction instructions

Try changing the settings in theme.json using the following code snippet example.
The problem is not only with the buttons, but also with the rest of the blocks.

Screenshots, screen recording, code snippet

"elements": {
	"button": {
		"spacing": {
			"padding": {
				"top": "var:preset|spacing|100", //  It doesn't work
				"right": "0", // It works
				"bottom": "var(--wp--preset--spacing--100)", // It doesn't work
				"left": "2rem" // It works => var(--wp--custom--spacing--*) too
		}
	}
}

Frontend:

Frontend

Site Editor:

Editor

Environment info

WordPress version: 6.0.1 and 6.1-alpha-53848
Gutenberg version: 13.9.20220805
Theme: TT2

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

No one assigned

    Labels

    [Feature] Site EditorRelated to the overarching Site Editor (formerly "full site editing")[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions