You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Style variations created with "Save as style variation" don't get a $schema property. theme.json does: CBT_Theme_JSON_Resolver::export_theme_data() adds $schema and puts it first. CBT_Theme_JSON::add_theme_json_variation_to_local() writes $theme_json->get_data() plus the title, without a schema.
Without $schema, editors can't validate the file or autocomplete keys, and theme validation tools warn about it. The default themes declare it in every variation (for example, Twenty Twenty-Five's styles/01-evening.json).
Steps to reproduce
Activate Twenty Twenty-Five with Create Block Theme.
Create a style variation with Create Block Theme ("Save as style variation"), or call CBT_Theme_JSON::add_theme_json_variation_to_local( 'variation', array( 'name' => 'Schema Test', 'slug' => 'cbt-schema-test' ) ).
Open styles/cbt-schema-test.json.
Expected
The file starts with the same $schema that Create Block Theme writes into theme.json, followed by version.
Actual
{
"version": 3,
"title": "Schema Test"
}
Environment
Create Block Theme 2.10.2
WordPress 7.1.3, Gutenberg 24.2.0
Drafted with AI assistance, reproduced and verified by me.
Activity
Style variations: Add $schema when saving variations (WordPress#886)
Style variations: add $schema when saving variations