Skip to content

theme.json schema: ref is not supported #45889

@mikachan

Description

@mikachan

Description

In #41696, we added the ability to reference values from other locations in the tree. However, currently, this isn't valid theme.json markup because the reference is an object rather than a string.

Step-by-step reproduction instructions

Add the following markup to a theme.json file:

		"elements": {
			"button": {
				"color": {
					"background": {
						"ref": "styles.color.text"
					},
					"text": {
						"ref": "styles.color.background"
					}
				}
			}
		}

You should see a warning in your text editor that the ref is an incorrect type (Incorrect type. Expected "string".).

Screenshots, screen recording, code snippet

No response

Environment info

No response

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

Developer ExperienceIdeas about improving block and theme developer experience

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions