Skip to content

Conversation

@t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Oct 9, 2022

What?

This PR adds the title property to the theme.json schema.

Why?

The title property is not currently defined as a schema. However, it is used as a mouse-over label in global style variations.
When the title property is absent, "Default" is displayed for theme.json and the file name for variations.

default

title

How?

Added title property and description to theme.json schema.
If you have a more appropriate description, please advise.

Testing Instructions

Confirm that the code editor outputs an error for the title property when referencing the trunk schema.

{
	"$schema": "https://schemas.wp.org/trunk/theme.json",
	"version": 2,
	"title": "Variation Name"
}

trunk

Confirm that the code editor displays the title property as a candidate and does not output an error when referencing this PR's schema.

{
	"$schema": "https://raw.githubusercontent.com/WordPress/gutenberg/add/theme-json-schema-title/schemas/json/theme.json",
	"version": 2,
	"title": "Variation Name"
}

pr

cc @mikachan Because we had a talk about the title property in the Twenty Twenty Three PR.

@t-hamano t-hamano marked this pull request as ready for review October 9, 2022 07:34
@t-hamano t-hamano requested a review from ajlende as a code owner October 9, 2022 07:34
@t-hamano t-hamano self-assigned this Oct 9, 2022
@t-hamano t-hamano added the Developer Experience Ideas about improving block and theme developer experience label Oct 9, 2022
Copy link
Contributor

@ajlende ajlende left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@ajlende ajlende merged commit 38d946a into trunk Oct 10, 2022
@ajlende ajlende deleted the add/theme-json-schema-title branch October 10, 2022 18:45
@github-actions github-actions bot added this to the Gutenberg 14.4 milestone Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Developer Experience Ideas about improving block and theme developer experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants