theme.json has no styles.elements when no design system is built

Open
#5,817 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
php, wordpress
Domain
backend

Research direction

Start by reading ThemeJsonProjection::withSystem() and the WordPressSitePlan path that skips it. Trace how the source element styles and unconditional link and heading defaults are projected when no design system exists. Done means those styles appear in generated theme.json, or a diagnostic explains their absence; the issue does not name a test to run.

Written by the indexing model from the issue text.

Description

Problem

The block-theme scorecard reports link, button and heading as used but unstyled (theme_json fails). The generated theme.json styles has only spacing and typography.lineHeight. Even the unconditional link/heading fontFamily: inherit default in ThemeJsonProjection is missing.

That default is written only inside withSystem(), which is skipped when the site plan has no usage-derived design system (WordPressSitePlan).

Expected

Element defaults, and the element styles observed in the source, are projected even when no design system is built. Otherwise a diagnostic should explain why they're absent.

Seen on

A 36-route import of a site built with a hosted site builder. Its scorecard reports unstyled_used: [link], along with the empty element styles above.

AI assistance: drafted with Claude (Anthropic) via Claude Code from a human-directed import investigation; measurements come from a real import.

Dominant language
PHP
Stars
28
Forks
5
Avg merge
2h 59m
Merged PRs (30d)
942

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 Automattic/blocks-engine

All issues in Automattic/blocks-engine

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.