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 defaultPresets property to shadow #49204

Merged
merged 2 commits into from
Mar 20, 2023

Conversation

t-hamano
Copy link
Contributor

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

Related to: #46813

What?

This PR adds the defaultPresets property to the shadow property of the theme.json schema.

defaultpresets

Why?

The dev note on the shadow property does not mention defaultPresets. However, I would expect this property to be controllable via theme.json.

How?

I have set additionalProperties to false in addition to adding the shadow property.

Testing Instructions

Create a JSON file that references this PR with the $schema property:

{
	"$schema": "https://raw.githubusercontent.com/WordPress/gutenberg/fix/schema-for-shadow-defaultpresets/schemas/json/theme.json",
	"version": 2,
	"settings": {
		"shadow": {
		}
	}
}
  • Under the shadow property, confirm the defaultPresets property is selectable.
  • Confirm that the code editor shows an error if you define properties other than defaultPresets and presets.

@t-hamano t-hamano marked this pull request as ready for review March 20, 2023 13:26
@t-hamano t-hamano self-assigned this Mar 20, 2023
@t-hamano t-hamano added [Type] Developer Documentation Documentation for developers Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json Developer Experience Ideas about improving block and theme developer experience labels Mar 20, 2023
@t-hamano
Copy link
Contributor Author

I have found that a similar schema fix was backported to wp/6.2 branch in #48948. I don't know if it is possible to backport it now, but I will give it a backport label just in case.

@github-actions
Copy link

Flaky tests detected in 793daa7.
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/4468654202
📝 Reported issues:

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.

This looks good to me. I found where shadow.defaultPresets is used.

And thanks for tightening up the additionalProperties for shadow. That's a good addition.

@ajlende ajlende merged commit 77bb6c8 into trunk Mar 20, 2023
@ajlende ajlende deleted the fix/schema-for-shadow-defaultpresets branch March 20, 2023 20:23
@github-actions github-actions bot added this to the Gutenberg 15.5 milestone Mar 20, 2023
@Mamaduka
Copy link
Member

I just cherry-picked this PR to the wp/6.2 branch to get it included in the next release: dcfb709

@Mamaduka Mamaduka 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 Mar 21, 2023
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 Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants