Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Mar 26, 2023

Conversation

t-hamano
Copy link
Contributor

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

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

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 added the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Mar 26, 2023
Copy link
Contributor

@andrewserong andrewserong left a comment

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
@ramonjd ramonjd removed the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label May 31, 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