Skip to content

Theme JSON schema: Add position.sticky and dimensions.minHeight properties to settings#49335

Merged
andrewserong merged 1 commit into
trunkfrom
schema/stiky-minheight
Mar 26, 2023
Merged

Theme JSON schema: Add position.sticky and dimensions.minHeight properties to settings#49335
andrewserong merged 1 commit into
trunkfrom
schema/stiky-minheight

Conversation

@t-hamano

@t-hamano t-hamano commented Mar 24, 2023

Copy link
Copy Markdown
Contributor

Related to:

What?

This PR fixes a problem in the theme.json schema where the following two properties in the settings global property cause validation errors (not arrowed error).

  • settings.position.sticky
  • settings.dimensions.minHeight

position_dimensions

This is probably due to the fact that the key is not determined in the settings > properties.

Testing Instructions

Create the following JSON file, specifying the JSON schema changed by this PR.

{
	"$schema": "https://raw.githubusercontent.com/WordPress/gutenberg/schema/stiky-minheight/schemas/json/theme.json",
	"version": 2,
	"settings": {
		"position": {
			"sticky": true
		},
		"dimensions": {
			"minHeight": true
		},
		"blocks": {
			"core/group": {
				"position": {
					"sticky": true
				},
				"dimensions": {
					"minHeight": true
				}
			}
		}
	}
}

When this file is opened in the code editor, confirm that no validation errors occur for all properties.

@t-hamano t-hamano added [Type] Developer Documentation Documentation for developers [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. labels Mar 24, 2023
@t-hamano t-hamano self-assigned this Mar 24, 2023
@t-hamano t-hamano requested a review from andrewserong March 24, 2023 12:53
@t-hamano t-hamano marked this pull request as ready for review March 24, 2023 12:53
@t-hamano t-hamano requested a review from ajlende as a code owner March 24, 2023 12:53
@github-actions

Copy link
Copy Markdown

Flaky tests detected in 2706fef.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4511342470
📝 Reported issues:

@andrewserong andrewserong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing this up @t-hamano, sorry I missed this one in the previous PR. Also, thanks for figuring out reliable testing instructions for it, that's working nicely, and I'll keep this in mind when I go to make future updates to the schema.

LGTM! ✨

@andrewserong andrewserong merged commit 247579e into trunk Mar 26, 2023
@andrewserong andrewserong deleted the schema/stiky-minheight branch March 26, 2023 22:18
@github-actions github-actions Bot added this to the Gutenberg 15.5 milestone Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants