WordPress / WordPress/create-block-theme

Bug: Fluid typography edits leave stale size value in theme.json

Open
#789 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

  • #796 by @Omcodes23 — closed without merging
bug theme.json
Dominant language
JavaScript
Stars
417
Forks
66
PR merge metrics
No merged PRs in 30d

Description

When editing Custom Fluid Typography values in the Site Editor, the plugin correctly updates the fluid object (min and max) inside theme.json, but fails to update the corresponding size value. The size property retains its previous value after saving, resulting in an inconsistent, outdated typography definition.

Steps to Reproduce
1.	Go to Styles → Typography and edit a Custom Fluid typography size.
2.	Change both Minimum and Maximum sizes.
3.	Click Save to update the theme via Create Block Theme.
4.	Check the generated theme.json.
Actual Behavior

In theme.json, only the fluid values are updated. Even after setting 5.63rem in the Editor, the size value remains "3rem" (or whatever it was before the change).

"fontSizes": [
  {
    "slug": "custom-fluid",
    "name": "Custom Fluid",
    "fluid": {
      "min": "1.5rem",
      "max": "5.63rem"  // updated correctly
    },
    "size": "3rem"      // ❌ still old value
  }
]
Image
Expected Behavior

The size property should be kept in sync with the user’s chosen Maximum size, just like other typography presets created or edited via the Editor. The size should never remain stale once a user updates a custom fluid size.

Contributor guide

Open the contributing guide

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.

Research direction

Reproduce the issue in the Site Editor by changing both Custom Fluid Typography limits, saving through Create Block Theme, and inspecting the generated theme.json. Trace the save path that updates the fluid object, then verify that the size property also matches the chosen Maximum size and no longer retains its previous value.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.