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: Incorrect validation on filter, outline, shadow #44442

Closed
t-hamano opened this issue Sep 25, 2022 · 0 comments · Fixed by #44799
Closed

theme.json schema: Incorrect validation on filter, outline, shadow #44442

t-hamano opened this issue Sep 25, 2022 · 0 comments · Fixed by #44799
Assignees
Labels
[Type] Developer Documentation Documentation for developers

Comments

@t-hamano
Copy link
Contributor

t-hamano commented Sep 25, 2022

Description

Related to:

JSON schema validation does not work correctly for filter, outline, and shadow, which are style supports recently added to theme.json.

These properties are considered invalid properties after entry, even though they are displayed as a list of input candidates by the code editor. This would mean that the JSON schema definitions are inconsistent.

This problem occurs for the following properties:

  • styles.outline
  • styles.shadow
  • styles.elements.button.:active.outline
  • styles.elements.button.:focus.outline
  • styles.elements.button.:hover.outline
  • styles.blocks.{blockName}.filter
  • styles.blocks.{blockName}.outline
  • styles.blocks.{blockName}.shadow

I will update the schema appropriately according to the expected specifications.

Step-by-step reproduction instructions

  • Save the following template as a JSON file:
{
	"$schema": "https://schemas.wp.org/trunk/theme.json",
	"version": 2,
	"styles": {
	}
}
  • Enter the properties according to the list above.
  • Confirm that the property is considered invalid after entry, even though it is displayed as a candidate.
3185bedcdcdee03a415afa0ecb79724b.mp4

Screenshots, screen recording, code snippet

The following is a list of all possible properties with filter, outline, and shadow added.
As you can see, some properties are considered invalid.

json_schema

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@t-hamano t-hamano added the [Type] Developer Documentation Documentation for developers label Sep 25, 2022
@t-hamano t-hamano self-assigned this Sep 25, 2022
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Oct 9, 2022
@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants