Skip to content

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

Closed

Description

@t-hamano

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

Activity

  1. self-assigned this
    on Sep 25, 2022
  2. added
    [Status] In Progress
    on Oct 9, 2022
  3. removed
    [Status] In Progress
    on Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Type] Developer Documentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions