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: Fix schema for useRootPaddingAwareAlignments #43628

Merged
merged 1 commit into from
Aug 27, 2022

Conversation

t-hamano
Copy link
Contributor

Fix #43624
Follow-up on #43463

What?

This PR fixes a problem in theme.json where the settings.useRootPaddingAwareAlignments key is not allowed in the schema and enables autocompletion.

Why?

This is because a definition for this property exists but does not refer to it.

How?

Added references to existing definitions.

Such references may seem strange, but in order to automatically generate theme.json living reference, each section of definitions must have a properties key even if the type is a boolean value. Therefore, I followed the tree of definitions to refer to the correct definition.

Testing Instructions

Create a JSON file that references the JSON schema for this branch, such as:

{
	"$schema": "https://raw.githubusercontent.com/WordPress/gutenberg/fix/theme-json-schema-root-padding/schemas/json/theme.json",
	"version": 2,
	"settings": {
	}
}

Under the settings property, confirm that the key is included in the candidates.

autocomplete_1

confirm that the key is not allowed lower down in the hierarchy.

autocomplete_2

Copy link
Member

@mikachan mikachan left a comment

Choose a reason for hiding this comment

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

Thank you! Works well for me:

image

@t-hamano t-hamano merged commit 3b6a399 into trunk Aug 27, 2022
@t-hamano t-hamano deleted the fix/theme-json-schema-root-padding branch August 27, 2022 01:55
@github-actions github-actions bot added this to the Gutenberg 14.1 milestone Aug 27, 2022
@cbravobernal cbravobernal added [Type] Developer Documentation Documentation for developers [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. labels Sep 13, 2022
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.

useRootPaddingAwareAlignments is missing from theme.json schema
3 participants