Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Style variations are saved without $schema

Open Beginner friendly
#886 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php, wordpress
Domain
backend

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
  1. Activate Twenty Twenty-Five with Create Block Theme.
  2. 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' ) ).
  3. 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from WordPress/create-block-theme

All issues in WordPress/create-block-theme

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.