gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

`styles.filter` does not validate against theme.json schema

Open ALJ opened this issue 4 years ago • 2 comments

Description

The Global Styles documentation has theme.json examples that include styles.filter, but that key is nowhere to be found in https://schemas.wp.org/trunk/theme.json causing its inclusion to invalidate the theme.json file.

Step-by-step reproduction instructions

Try to validate this theme.json file, copied (and shortened) from the Global Styles documentation:

{
  "$schema": "https://schemas.wp.org/trunk/theme.json",
  "version": 2,
  "styles": {
    "filter": {
      "duotone": "value"
    }
  }
}

And get a "Property filter is not allowed" notice.

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress 5.9.3
  • Gutenberg plugin inactive

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

ALJ avatar Apr 16 '22 01:04 ALJ

Thanks for pointing this out @ALJ, I think this might be a documentation error. I have never used filter and have no idea what it was intended for. 🤔

ndiego avatar Apr 18 '22 12:04 ndiego

Hi @ndiego, this Core Make post from a few months ago mentions this new filter:

The following section documents the changes done to styles in v2: ... filter: new section to allow themes to attach filters to styles. So far, it only includes the duotone filter. ...

But I couldn't find any information about what it does 🤷 The best I could find for any help/context is this fullsiteediting.com page. If you search for "filter" on that page, you'll see it. That makes me think it's a legit new key in theme.json, and if so:

  1. The theme.json schema needs to be updated.
  2. The official documentation needs to be updated to explain what filter is and why one would use it.

ALJ avatar Apr 18 '22 20:04 ALJ