theme.json

The small settings file that tells the block editor what the theme's widths and spacing are.

Stoat ships a theme.json. It is deliberately short:

{
  "version": 3,
  "settings": {
    "layout": { "contentSize": "640px", "wideSize": "900px" },
    "spacing": {
      "padding": true,
      "margin": true,
      "units": [ "px", "em", "rem", "%", "vw", "vh" ]
    }
  }
}

What it does

contentSize and wideSize are what the editor reads to decide whether the Wide and Full alignment buttons exist, and how wide a Wide block is drawn. Since WordPress 6.x the editor takes the layout path rather than looking at add_theme_support( 'align-wide' ), so without these two values the alignment buttons would simply not appear.

They match the theme’s own defaults: 640px is the narrow width, and 900px sits between it and the container.

spacing.padding and margin turn on the block Dimensions panel, so a Group or a Cover can carry its own spacing. The unit list is the one the Customizer’s own sliders speak.

What it deliberately leaves out

No colour palette, no font sizes, no typography presets, no styles block at all.

That is the choice that keeps the theme coherent. Colours live in Customize → Style and typography in Customize → Typography, where they are previewed live and apply to the entire site. A theme.json palette would give you a second set of colours, editable in a different place, that the first set knows nothing about — and then every post would carry hard-coded colour classes that survive a palette change.

Stoat’s front end is styled by one stylesheet reading CSS custom properties. The Customizer overrides those properties. That is the whole model.

Overriding it

theme.json is a theme file, so editing it directly is lost on update. A child theme may carry its own theme.json, which is merged over the parent’s — that is the supported way to add a palette if you want one.

For widths, do not use theme.json: change them in Customize → Layout, which moves the front end and the editor canvas together.

Last updated September 13, 2026

Something missing or out of date? Ask us and we will fix the page.