Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 2.64 KB

README.md

File metadata and controls

59 lines (43 loc) · 2.64 KB

Theme JSON Generator documentation

Write WordPress theme configuration in PHP, then generate theme.json and style variation JSON files during development or your build. WordPress uses the generated files; it does not need to run this generator on production requests.

These pages describe the current repository API. When using a published version, check that its commands and methods match the examples. The package is experimental; review changes before upgrading.

Start here

  1. Installation and requirements
  2. Generate your first theme.json
  3. Understand the generation workflow

The examples follow a small theme with a primary color, a body font size, and a dark variation. Each chapter explains which file to edit. Commands use vendor/bin/theme-json from the theme root; global installations use theme-json.

Write your configuration

Chapter What you will learn
Entrypoints and ThemeJson Return a callable, set metadata, and use generic paths
Settings Configure editor controls, layout, spacing, and custom values
Presets and references Register reusable values and use them in styles
Typography and fonts Font families, font files, font sizes, and fluid typography
Styles and scopes Global styles, blocks, elements, states, and block style variations
Templates and patterns Register template metadata and Pattern Directory slugs

Organize a larger theme

Work with assets

Automate generation

Look something up

For work on the generator itself, see Contributing.