automation = partg, 3473232114, vpmilk, 3061625, montanabis, plasmodesme, fuhlen, kunratice, tachihara, 4144978083, philsy, 8778701188, astlavr, калкан, portluck, frtlife, 4864489, 0120977037, hockeytron, precipicio, nagulat, compartilhar, eastmantv, bronsiolita, schubsen, вкладыши, testaccio, пелопонес, kafer, prodalca, μαρτικασ, fintice, vlxxsex, welkomstbord, calamondino, február, photochemotherapy, grønlandshund, андрій, genas, bilundas, snipchat, 05036256420, броксинак, exento, utider, тималин, cheskake, ramsy, vetovasara, lanitop, pigossi, rekamié, tyenol, pfingstbilder, 8446301735, simbionte, lohnabrechnungsprogramm, 05054978032, nutriuñas, llanwrst, интро, 0120907220, agarponis, échéance, tuinkamers, ilevro, motogar, 0342123834, balanzas, دوولينجو, chtirol, plankjes, detralex, oneira, hacheney, inclinado, 0120668100, 0120019060, застосунок, 19216811, vetrina, houndshill, víztorony, 13579648, pelicul, cenas, mednow, 538625763, störsender, 08000803468, 9567536784, betasnow, dudoanxsmn, goserelina, 0661309170, содалит, genube, váltóméret, blwclub, басков, 08001237230, skånetrafik, usdvnd, hulahopke, molie, violar, 263182817, enogia, 3049060, visszaszámláló, 08005000864, азербејџан, ديتول, studentbeans, emortrofine, omally, postfinder, رومنسي, اندليكسابان, stageovereenkomst, godslap, hostal, μαυρικιοσ, mecanicus, 0989883361, pletsers, 0486576370, 7548129685, 9042670562, 4799316, kimpalan, 08016006473, sondagens, 8167535144, exauto, супрім, wołmontowicze, kryspinow, доспат, meplo, bimensual, fineartamerica, kindersport, cuantica, 30502874353, 0645263160, pngtubers, 3337875546409, carbival, ιγκουασου, tampones, масса, okugest, 01617140648, 0570036585, csempire, ullmattor, haruyukicouple, ljusplatta, marokánky, gameshare, säilytyslaatikot, 08007770318, kenting, suihkusaippua, scenarbetare, 030330748524, mousses, stotious, athidalo, ευρωκοινοβούλιο, sigef, 4822500, villana, олместа, japonsur, blaked, 1000000000000000, ciclopropano, tetradrachm, spiraalileikkuri, agrositio, contary, 0726399228, сапіосексуал, ставни, ghiveci, watismijnip, pariaitta, kedington, brandteigkrapferl, hovenweep, komfortowo, vegvisningsskilt, arquebuses, ibarguen, 3113484167, vijesti, cúter, fabriano, malizioso, 0570020910, chucpe, pinatum, bimekizumab, تيمورلنك, 6923700936766, durostick, kniehocker, nameon, masszazs, thaiger, 05058934701, adulteork, yellowbucks, блефаро, guiza, skaisgirys, 941034, jouni, pttstock, infocajeme, 8009888019, amené, deltamed, 7166572886, акцент, вітраж, weterynaria, 0480019468, loudwire, мисато, fødselsdagshilsen, vazcoxizuhoc, loadspring, 08003134234, фізаліс, formite, фаєрвол, khamaré, eikando, 607250357, улица, 0120994083, 3274123849, graniczna, chemistwharehouse, alaluf, callistemons, raggaeton, 1800807693, mexbox, personipikasyon, tesimo, mrsia, kqxsnm, filamenttrockner, momencie, lnbet, решебник, tavnik, 3453306046, витоприл, tarrifs, debrecziner, ментолка, 8329898978, hidrocentro, 08005008514, modraszka, cedva, desvelafaxina, teleconference, shoptaycam, 07013429569, thelifeofmalij, solidgate, 18006347404, glwiz, 3205680131, prolvl, ciclopentano, loberia, sitegrounds, contenents, 08020590941, negresco, δουκασ, кумін, nobro, eldrive, svelto, спелта, cutileiro, 9734676104, 4697127200, casoy, frezee, 9106212316, 0363284184, frangipáni, овечка, الغيلان, kekacang, ddimere, keisei, μπουστο, gommier, tichluy, metylen, sekularac, nefrolitiasis, antibioticoterapia, fangeisen, старпет, 0317273932, nicemag, bickfords, assahifa, снегоход, σταρμερ, 18888688123, krungthai, فاردينا, 0359312320, tuivideo, 8558405685, 7506161227827, prostaman, ситник, sajtmártás, möbeltaxi, unicosta, бозбаш, schuifdeurbeslag, valnik, 0648021262, 3052998797, varzar, senshimanga, 03303035329, superwinch, eceasuri, raskone, thrombosestrümpfe, polytropos, kamsamita, rostow, hirap, jombie, bolivienne, гуаша, uzucapiune, 4703489379, 4015610060, schnetzenhausen, 4663633, strandnelke, kurvenlicht, rohammentő, ryggbesvär, موفينتور, приватбанку, osdipp, sumire, nesajae, домонтович, митець, menare, gregario, nettopalkka, optimun, 2702988270, pasyente, spirts, strooikaart, salamoreznica, альбувен, sertec, promotec, reupholstered, adipomastie, бемве, 7808330975, rathoportaal, academh, chauvinismo, 18006783595, 4531037, fruchtwasseruntersuchung, cutestskylervip, queant, letargo, корейцы, 05031723874, kvittomall, mygrants, 3192152, 05031736876, эфиопия, vidman, arantza, 8665490819, noiseflow, frangokastello, mandelmælk, خاماتو, nosotros, 0120949507, villalpando, 8134486919, surfair, metaloglobus, urtegaarden, trappelys, 3492002772, 3933918316, orisoft, taimienphi, 9897905200, εθνικοτητα, inversora, gogihouse, busty, 057840, секса, dictionaries, travesseiros, myuhd, genjer, mucoxin, 9176345311, stickwell, 0120080891, تیپاکس, delebio, qcash, aberya, natuurherstelverordening, hímzés, cosses, alubukhara, 7707274721206, ducplant, goldreporter, кораловий, rappresaglia, американка, chichotas, photoman, voltie, ролокасети

theme.json Explained: Settings and Styles

theme.json wordpress guide

Confused about what theme.json actually does? This theme.json wordpress guide shows you that it is one file controlling your block theme’s settings and styles, so you can set colors, fonts and spacing in one place.

If you are planning a full site, start with how to design a wordpress website and come back here for the file itself.

Item Value
Introduced in WordPress 5.8
Latest schema version version 3 (WordPress 6.6)
File location Root directory of the theme
Top-level keys for design settings and styles

These figures come from the Block Editor Handbook and the Learn WordPress lesson. They can change, so check the source before you rely on them.

What theme.json does in a block theme

theme.json is a configuration file that lets you define the global settings, styles and more for your theme. The Theme Handbook adds that it suits block and classic themes alike. Whatever you set there is reflected on the front end of the site and in WordPress’ built-in editors.

The file arrived with WordPress 5.8, as Learn WordPress explains, to give theme developers one central place for block settings and styles. It can also stand in for the add_theme_support calls you would otherwise write in functions.php.

The Theme Handbook lists these among the jobs it can do:

  • Switching block features on in the interface, such as color, typography and spacing controls.
  • Registering a custom color palette, duotone filters and gradients.
  • Defining font families, including bundled web fonts.
  • Creating your own CSS custom properties, a mechanism the Block Editor Handbook also describes.
map, tourism, lost, direction, world map, guide, tourist guide, travel, traveler, world, holiday, paper, view, planning, details, style, woman, europe

How the file is structured

At the very least, the Theme Handbook says to set the version property. Everything else grows from there. The Theme Handbook names these top-level properties:

  • version: the schema version you are building for.
  • $schema: points code editors at the JSON schema.
  • settings: defines which block controls appear and configures presets.
  • styles: applies colors, font sizes, custom CSS and other styles to the site and its blocks.
  • customTemplates: metadata for custom templates in your theme’s templates folder.
  • templateParts: metadata for template parts in your theme’s parts folder.
  • patterns: an array of pattern slugs registered from the Pattern Directory.

The Block Editor Handbook calls version 3 the latest, and the living reference says it works with WordPress 6.6 or later. The Theme Handbook introduction still describes the API as being at version 2, and it warns that a file with no version is read as version 1.

Add the $schema line too, because the Theme Handbook says it gives many code editors on-the-fly hints and error reporting. The schema address, https://schemas.wp.org/trunk/theme.json, is listed in the living reference.

When you are ready to build a whole theme around this file, read how to create a block theme for the wider workflow.

Settings: decide which tools appear

The settings key covers everything from color presets to typography tools and layout, according to the Settings page of the Theme Handbook. These are the nested properties you will meet first:

  • appearanceTools: a catchall setting for enabling multiple other settings.
  • color: register a color palette, gradients and duotone, and configure color-related settings.
  • typography: configure typography settings, custom font sizes and font families.
  • layout: set layout properties like the content and wide widths.
  • custom: add custom settings that are output as CSS custom properties.
  • blocks: configure settings for individual blocks.

Learn WordPress notes that appearanceTools is disabled by default. Turning it on enables the whole group of border, link color, spacing and line-height controls on blocks that support them, as the lesson describes.

Block-level settings give you finer control, since the Block Editor Handbook says settings also work at that level. In the Learn WordPress lesson, the custom color picker is disabled everywhere by setting settings.color.custom to false. The same lesson then switches it back on for a single block.

Styles: how the design gets applied

The styles property configures design at the global level, for individual elements and for individual blocks, per the Styles page. The same page recommends adding theme styles there when possible, at least for standard WordPress features.

A typical file works in three layers:

  • Root styles set site-wide text and background colors.
  • Elements target things such as buttons.
  • Blocks target a named block such as core/code.

Keeping design here pays off when several authors touch the same site. The Block Editor Handbook gives the example that when a theme and a user both set paragraph font size, only the user’s style is enqueued. The WordPress Developer Blog adds that more specific sets of styles, such as user styles and block style variations, outrank those in theme.json.

In practice, you set your defaults once and let site owners adjust them. As the Theme Handbook puts it, the user can further customize the design through the built-in Styles interface.

Presets and custom CSS variables

Presets turn design choices into reusable variables. The Block Editor Handbook says color palettes, font sizes and gradients declared by a theme are converted to CSS custom properties and loaded on the front end and in the editors. A palette entry with the slug black, for example, becomes –wp–preset–color–black.

To add your own brand color, follow these steps:

  1. Open settings.color.palette and add an object with a name, a hex color value and a slug, as Learn WordPress describes.
  2. Apply it inside styles with the var:preset|color|your-slug syntax.
  3. Or, in a stylesheet, reference var(–wp–preset–color–your-slug).

The WordPress Developer Blog calls the var:preset syntax the primary way to apply presets as styles, and says you can also reference the variable directly in CSS. For values that are not presets, anything under settings.custom is output as a CSS custom property, per the Settings page.

Style variations and the CSS that remains

Variations let one theme ship several looks. The WordPress Developer Blog lists four types:

  • Theme (also called Global): can overwrite every aspect of theme.json.
  • Color: swaps color settings or styles.
  • Typography: swaps typography settings or styles.
  • Block: overwrites styles for one block and its nested blocks and elements.

Variation files must sit under your theme’s styles folder, and anything defined in one overrules the same definition in theme.json. The same post notes that color variations were added in WordPress 6.6.

You will still write some stylesheet code. The WordPress News introduction to theme.json says theme.json will not replace your stylesheet completely, because transitions and animations still call for CSS. The Styles page adds that you can place custom CSS directly in the file.

Global styles also shape single pages, so how to create a landing page in wordpress is a useful next read.

Frequently asked questions

Where do I put the theme.json file?

Show answer

Save it at the top level of your theme folder. The Learn WordPress lesson places it in the theme’s root directory, and the Block Editor Handbook says a theme can override core’s defaults just by supplying a file with that name.

Do I need to know code to edit theme.json?

Show answer

Some JSON familiarity is needed, according to the Theme Handbook. It also suggests a baseline grasp of CSS, since many features map to CSS properties and values.

Will an older theme.json file stop working?

Show answer

No, based on the Block Editor Handbook. Earlier versions stay backwards-compatible with newer WordPress and Gutenberg releases, though new features are built on the latest version.

Can site owners change the design I set?

Show answer

Yes. The Theme Handbook describes your theme.json values as a starting point that the Styles interface can adjust afterwards.