Style variations are saved without $schema
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
Research direction
Start in CBT_Theme_JSON::add_theme_json_variation_to_local(), which writes the variation file from $theme_json->get_data() plus the title. Compare it with CBT_Theme_JSON_Resolver::export_theme_data(), which adds $schema first, and reuse the same schema value. Done when a newly saved variation file starts with $schema followed by version, and its title is still present.
Written by the indexing model from the issue text.
Description
Description
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.
- Dominant language
- JavaScript
- Stars
- 424
- Forks
- 69
- Avg merge
- 18h 59m
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from WordPress/create-block-theme
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
WordPress/create-block-theme#885 · 1 reaction ·
Maintainers usually reply within 2 days
-
Localize Text wraps empty block attribute values in a translation callPossibly taken @ishitaj34 claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
WordPress/create-block-theme#879 ·
Maintainers usually reply within 2 days
-
Generated pattern headers use the template slug as title and category names instead of slugsPossibly taken @ishitaj34 claimed this 14 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
WordPress/create-block-theme#871 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
WordPress/create-block-theme#868 ·
Maintainers usually reply within 2 days
-
Localize Text skips Accordion headingsPossibly taken @kushagra-goyal-14 claimed this 18 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
WordPress/create-block-theme#867 ·
Maintainers usually reply within 2 days
All issues in WordPress/create-block-theme
Similar issues
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
andromarces/agent-loops#886 ·
Maintainers usually reply within 1 day
-
bug effort:low model:light plan planner:gpt-6-1-sol tests
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
B: visual
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
FreeTubeApp/FreeTube#9929 ·
Maintainers usually reply within 1 day
-
🐛 Bug: `--clear-screen` not very useful (at least not for dealing with large test/error output)Openstatus: in triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
mochajs/mocha#6428 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
supabase/supabase-js#2768 ·
Maintainers usually reply within 1 day