From d36b40d89e50b67bad4bd9f327f1f3bb24c4614a Mon Sep 17 00:00:00 2001 From: Alex Lende Date: Tue, 30 Apr 2024 12:45:37 -0500 Subject: [PATCH] Update documentation for theme.json version 3 (#61221) Co-authored-by: ajlende Co-authored-by: fabiankaegy Co-authored-by: juanmaguitar Co-authored-by: oandregal --- .../patterns.md | 3 +- .../theme-json.md | 16 ++--- .../themes/global-settings-and-styles.md | 67 +++++++++++-------- docs/how-to-guides/themes/theme-support.md | 1 - docs/manifest.json | 10 ++- docs/reference-guides/README.md | 3 +- .../theme-json-reference/README.md | 3 +- .../theme-json-reference/theme-json-living.md | 19 ++---- .../theme-json-migrations.md | 18 +++-- .../theme-json-reference/theme-json-v1.md | 20 +++++- .../theme-json-reference/theme-json-v2.md | 40 +++++------ docs/toc.json | 3 + 12 files changed, 115 insertions(+), 88 deletions(-) diff --git a/docs/how-to-guides/curating-the-editor-experience/patterns.md b/docs/how-to-guides/curating-the-editor-experience/patterns.md index fbe5143298cdb..abb7d131041df 100644 --- a/docs/how-to-guides/curating-the-editor-experience/patterns.md +++ b/docs/how-to-guides/curating-the-editor-experience/patterns.md @@ -79,12 +79,11 @@ With WordPress 6.0 themes can register patterns from [Pattern Directory](https:/ ```json { - "version": 2, "patterns": [ "short-text-surrounded-by-round-images", "partner-logos" ] } ``` -Note that this field requires using [version 2 of theme.json](/docs/reference-guides/theme-json-reference/theme-json-living.md). The content creator will then find the respective Pattern in the inserter “Patterns” tab in the categories that match the categories from the Pattern Directory. +The content creator will then find the respective Pattern in the inserter “Patterns” tab in the categories that match the categories from the Pattern Directory. ## Additional resources diff --git a/docs/how-to-guides/curating-the-editor-experience/theme-json.md b/docs/how-to-guides/curating-the-editor-experience/theme-json.md index d373e0e81e345..d14f29e0a76f3 100644 --- a/docs/how-to-guides/curating-the-editor-experience/theme-json.md +++ b/docs/how-to-guides/curating-the-editor-experience/theme-json.md @@ -10,7 +10,7 @@ Since theme.json acts as a configuration tool, there are numerous ways to define ```json { -"version": 2, + "version": 3, "settings": { "color": { "customDuotone": true, @@ -25,7 +25,7 @@ Since theme.json acts as a configuration tool, there are numerous ways to define ```json { - "version": 2, + "version": 3, "settings": { "color": { "duotone": [ @@ -54,8 +54,7 @@ Since theme.json acts as a configuration tool, there are numerous ways to define ```json { - "schema": "https://schemas.wp.org/trunk/theme.json", - "version": 2, + "version": 3, "settings": { "color": { "custom": true, @@ -89,8 +88,7 @@ Since theme.json acts as a configuration tool, there are numerous ways to define ```json { - "schema": "https://schemas.wp.org/trunk/theme.json", - "version": 2, + "version": 3, "settings": { "color": { "custom": true, @@ -132,8 +130,7 @@ Continuing the examples with duotone, this means you could allow full access to ```json { - "schema": "https://schemas.wp.org/trunk/theme.json", - "version": 2, + "version": 3, "settings": { "color": { "custom": true, @@ -178,8 +175,7 @@ When using theme.json in a block or classic theme, these settings will stop the ```json { - "$schema": "http://schemas.wp.org/trunk/theme.json", - "version": 2, + "version": 3, "settings": { "layout": { "contentSize": "750px" diff --git a/docs/how-to-guides/themes/global-settings-and-styles.md b/docs/how-to-guides/themes/global-settings-and-styles.md index 37f0ee8951c3c..730595df4d4be 100644 --- a/docs/how-to-guides/themes/global-settings-and-styles.md +++ b/docs/how-to-guides/themes/global-settings-and-styles.md @@ -1,6 +1,6 @@ # Global Settings & Styles (theme.json) -WordPress 5.8 comes with [a new mechanism](https://make.wordpress.org/core/2021/06/25/introducing-theme-json-in-wordpress-5-8/) to configure the editor that enables a finer-grained control and introduces the first step in managing styles for future WordPress releases: the `theme.json` file. Then `theme.json` [evolved to a v2](https://make.wordpress.org/core/2022/01/08/updates-for-settings-styles-and-theme-json/) with WordPress 5.9 release. This page documents its format. +WordPress 5.8 comes with [a new mechanism](https://make.wordpress.org/core/2021/06/25/introducing-theme-json-in-wordpress-5-8/) to configure the editor that enables a finer-grained control and introduces the first step in managing styles for future WordPress releases: the `theme.json` file. ## Rationale @@ -48,7 +48,7 @@ To address this need, we've started to experiment with CSS Custom Properties, ak ```json { - "version": 2, + "version": 3, "settings": { "color": { "palette": [ @@ -86,7 +86,7 @@ body { ```json { - "version": 2, + "version": 3, "settings": { "custom": { "line-height": { @@ -115,7 +115,7 @@ This specification is the same for the three different origins that use this for ```json { - "version": 2, + "version": 3, "settings": {}, "styles": {}, "customTemplates": {}, @@ -125,10 +125,13 @@ This specification is the same for the three different origins that use this for ### Version -This field describes the format of the `theme.json` file. The current version is [v2](https://developer.wordpress.org/block-editor/reference-guides/theme-json-reference/theme-json-living/), [introduced in WordPress 5.9](https://make.wordpress.org/core/2022/01/08/updates-for-settings-styles-and-theme-json/). It also works with the current Gutenberg plugin. +This field describes the format of the `theme.json` file. The latest version is [version 3](https://developer.wordpress.org/block-editor/reference-guides/theme-json-reference/theme-json-living/) introduced in WordPress 6.6. -If you have used [v1](https://developer.wordpress.org/block-editor/reference-guides/theme-json-reference/theme-json-v1/) previously, you don’t need to update the version in the v1 file to v2, as it’ll be [migrated](https://developer.wordpress.org/block-editor/reference-guides/theme-json-reference/theme-json-migrations/) into v2 at runtime for you. +New versions are introduced when a breaking change needs to be made. This allows theme authors to choose when to opt-in to the breaking changes and migrate their theme.json files to the new format. +Older versions of `theme.json` are backwards-compatible and will continue to work with newer versions of WordPress and the Gutenberg plugin. However new features will be developed on the latest version. + +Follow the instructions in [migrating to newer versions](https://developer.wordpress.org/block-editor/reference-guides/theme-json-reference/theme-json-migrations/) for details on updating to the latest version. ### Settings @@ -145,7 +148,7 @@ The settings section has the following structure: ```json { - "version": 2, + "version": 3, "settings": { "border": { "radius": false, @@ -209,7 +212,7 @@ The settings section has the following structure: ```json { - "version": 2, + "version": 3, "settings": { "appearanceTools": false, "border": { @@ -357,7 +360,7 @@ The naming schema for the classes and the custom properties is as follows: ```json { - "version": 2, + "version": 3, "settings": { "color": { "duotone": [ @@ -532,7 +535,7 @@ For example: ```json { - "version": 2, + "version": 3, "settings": { "custom": { "baseFont": 16, @@ -577,7 +580,7 @@ Note that the name of the variable is created by adding `--` in between each nes ```json { - "version": 2, + "version": 3, "settings": { "color": { "custom": false @@ -597,7 +600,7 @@ Note that the name of the variable is created by adding `--` in between each nes ```json { - "version": 2, + "version": 3, "settings": { "blocks": { "core/button": { @@ -614,7 +617,7 @@ Note that the name of the variable is created by adding `--` in between each nes ```json { - "version": 2, + "version": 3, "settings": { "color": { "palette": [ @@ -682,7 +685,7 @@ Each block declares which style properties it exposes via the [block supports me ```json { - "version": 2, + "version": 3, "styles": { "border": { "radius": "value", @@ -761,7 +764,7 @@ Each block declares which style properties it exposes via the [block supports me ```json { - "version": 2, + "version": 3, "styles": { "border": { "color": "value", @@ -856,7 +859,7 @@ Styles found at the top-level will be enqueued using the `body` selector. ```json { - "version": 1, + "version": 3, "styles": { "color": { "text": "var(--wp--preset--color--primary)" @@ -885,7 +888,7 @@ By default, the block selector is generated based on its name such as `.wp-block ```json { - "version": 1, + "version": 3, "styles": { "color": { "text": "var(--wp--preset--color--primary)" @@ -972,7 +975,7 @@ If they're found in the top-level the element selector will be used. If they're ```json { - "version": 1, + "version": 3, "styles": { "typography": { "fontSize": "var(--wp--preset--font-size--normal)" @@ -1066,7 +1069,7 @@ For example, this is how to provide styles for the existing `plain` variation fo ```json { - "version": 2, + "version": 3, "styles":{ "blocks": { "core/quote": { @@ -1103,7 +1106,7 @@ Within this field themes can list the custom templates present in the `templates ```json { - "version": 2, + "version": 3, "customTemplates": [ { "name": "my-custom-template", @@ -1132,7 +1135,7 @@ Currently block variations exist for "header" and "footer" values of the area te ```json { - "version": 2, + "version": 3, "templateParts": [ { "name": "my-template-part", @@ -1145,22 +1148,28 @@ Currently block variations exist for "header" and "footer" values of the area te ### patterns -
Supported in WordPress from version 6.0 using version 2 of theme.json.
+
Supported in WordPress from version 6.0.
Within this field themes can list patterns to register from [Pattern Directory](https://wordpress.org/patterns/). The `patterns` field is an array of pattern `slugs` from the Pattern Directory. Pattern slugs can be extracted by the `url` in single pattern view at the Pattern Directory. For example in this url `https://wordpress.org/patterns/pattern/partner-logos` the slug is `partner-logos`. ```json { - "version": 2, + "version": 3, "patterns": [ "short-text-surrounded-by-round-images", "partner-logos" ] } ``` ## Developing with theme.json -It can be difficult to remember the theme.json settings and properties while you develop, so a JSON scheme was created to help. The schema is available at https://schemas.wp.org/trunk/theme.json +It can be difficult to remember the theme.json settings and properties and which versions of WordPress support which settings while you develop, so it can be helpful to use the provided JSON schema for theme.json. + +Many code editors support JSON schema and can provide help like tooltips, autocomplete, or schema validation right in your editor. + +Theme.json schemas for each WordPress version are available at `https://schemas.wp.org/wp/{{version}}/theme.json`. For example a schema for WordPress 5.8 is available at `https://schemas.wp.org/wp/5.8/theme.json`. To ensure that you're only using features available to your users, it's best to use the oldest version that your theme supports. + +The latest schema including all the latest changes from the Gutenberg plugin is available at `https://schemas.wp.org/trunk/theme.json`. -Code editors can pick up the schema and can provide help like tooltips, autocomplete, or schema validation in the editor. To use the schema in Visual Studio Code, add `"$schema": "https://schemas.wp.org/trunk/theme.json"` to the beginning of your theme.json file. +Check your editor's documentation for JSON schema support. In Visual Studio Code, for example, you need to add `"$schema": "https://schemas.wp.org/wp/x.x/theme.json"` as a top-level property of your theme.json file, but other editors may be configured differently. ![Example using validation with schema](https://developer.wordpress.org/files/2021/11/theme-json-schema-updated.gif) @@ -1210,7 +1219,7 @@ For example: ```json { - "version": 2, + "version": 3, "settings": { "custom": { "lineHeight": { @@ -1240,7 +1249,7 @@ A few notes about this process: ```json { - "version": 2, + "version": 3, "settings": { "custom": { "line--height": { // DO NOT DO THIS @@ -1284,7 +1293,7 @@ body { ### Specificity for link colors provided by the user -In v1, when a user selected a link color for a specific block we attached a class to that block in the form of `.wp-element-` and then enqueued the following style: +In WordPress 5.8, when a user selected a link color for a specific block we attached a class to that block in the form of `.wp-element-` and then enqueued the following style: ```css .wp-element- a { color: !important; } @@ -1304,7 +1313,7 @@ For blocks that contain inner blocks, such as Group, Columns, Buttons, and Socia ```json { - "version": 2, + "version": 3, "settings": { "spacing": { "blockGap": true, diff --git a/docs/how-to-guides/themes/theme-support.md b/docs/how-to-guides/themes/theme-support.md index edf4b8e505c13..e5d6c34e4081c 100644 --- a/docs/how-to-guides/themes/theme-support.md +++ b/docs/how-to-guides/themes/theme-support.md @@ -442,7 +442,6 @@ Link support has been made stable as part of WordPress 5.8. It's `false` by defa ```json { - "version": 1, "settings": { "color": { "link": true diff --git a/docs/manifest.json b/docs/manifest.json index 87ab88aa8cc54..05f1f36ce7ca6 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -582,7 +582,7 @@ "parent": "reference-guides" }, { - "title": "Theme.json Version 3", + "title": "Theme.json Version 3 Reference (latest)", "slug": "theme-json-living", "markdown_source": "../docs/reference-guides/theme-json-reference/theme-json-living.md", "parent": "theme-json-reference" @@ -594,7 +594,13 @@ "parent": "theme-json-reference" }, { - "title": "Migrating to Newer Versions", + "title": "Theme.json Version 2 Reference", + "slug": "theme-json-v2", + "markdown_source": "../docs/reference-guides/theme-json-reference/theme-json-v2.md", + "parent": "theme-json-reference" + }, + { + "title": "Migrating Theme.json to Newer Versions", "slug": "theme-json-migrations", "markdown_source": "../docs/reference-guides/theme-json-reference/theme-json-migrations.md", "parent": "theme-json-reference" diff --git a/docs/reference-guides/README.md b/docs/reference-guides/README.md index b9725af66f080..cc30aa8752605 100644 --- a/docs/reference-guides/README.md +++ b/docs/reference-guides/README.md @@ -39,7 +39,8 @@ ## [Theme.json Reference](/docs/reference-guides/theme-json-reference/README.md) -- [Version 2 (living reference)](/docs/reference-guides/theme-json-reference/theme-json-living.md) +- [Version 3 (latest)](/docs/reference-guides/theme-json-reference/theme-json-living.md) +- [Version 2](/docs/reference-guides/theme-json-reference/theme-json-v2.md) - [Version 1](/docs/reference-guides/theme-json-reference/theme-json-v1.md) - [Migrating to Newer Versions](/docs/reference-guides/theme-json-reference/theme-json-migrations.md) diff --git a/docs/reference-guides/theme-json-reference/README.md b/docs/reference-guides/theme-json-reference/README.md index 11605b21625ad..9f53a09a97e66 100644 --- a/docs/reference-guides/theme-json-reference/README.md +++ b/docs/reference-guides/theme-json-reference/README.md @@ -2,9 +2,10 @@ This reference guide lists the settings and style properties defined in the theme.json schema. See the [theme.json how to guide](/docs/how-to-guides/themes/global-settings-and-styles.md) for examples and guide on how to use the theme.json file in your theme. -- [Version 2 (living reference)](/docs/reference-guides/theme-json-reference/theme-json-living.md) +- [Version 3 (latest)](/docs/reference-guides/theme-json-reference/theme-json-living.md) ## Older versions - [Migrating to Newer Theme.json Versions](/docs/reference-guides/theme-json-reference/theme-json-migrations.md) - [Version 1](/docs/reference-guides/theme-json-reference/theme-json-v1.md) +- [Version 2](/docs/reference-guides/theme-json-reference/theme-json-v2.md) diff --git a/docs/reference-guides/theme-json-reference/theme-json-living.md b/docs/reference-guides/theme-json-reference/theme-json-living.md index bea655e61af82..0c852324ba59d 100644 --- a/docs/reference-guides/theme-json-reference/theme-json-living.md +++ b/docs/reference-guides/theme-json-reference/theme-json-living.md @@ -1,6 +1,6 @@ -# Theme.json Version 3 +# Theme.json Version 3 Reference (latest) -> This is the living specification for **version 3** of `theme.json`. This version works with WordPress 5.9 or later, and the latest Gutenberg plugin. +> This is the living specification for **version 3** of `theme.json`. This version works with WordPress 6.6 or later, and the latest Gutenberg plugin. > > There are some related documents that you may be interested in: > - the [theme.json v1](/docs/reference-guides/theme-json-reference/theme-json-v1.md) specification, @@ -9,20 +9,15 @@ This reference guide lists the settings and style properties defined in the `theme.json` schema. See the [theme.json how to guide](/docs/how-to-guides/themes/global-settings-and-styles.md) for examples and guidance on how to use the `theme.json` file in your theme. -## Schema +## JSON Schema -Remembering the `theme.json` settings and properties while you develop can be difficult, so a [JSON schema](https://schemas.wp.org/trunk/theme.json) was created to help. +This documentation was generated from the JSON schema for theme.json. -Code editors can pick up the schema and can provide helpful hints and suggestions such as tooltips, autocomplete, or schema validation in the editor. To use the schema in Visual Studio Code, add `$schema`: "https://schemas.wp.org/trunk/theme.json" to the beginning of your theme.json file together with a `version` corresponding to the version you wish to use, e.g.: +The latest schema for version 3 including all the latest changes from the Gutenberg plugin is available at `https://schemas.wp.org/trunk/theme.json`. -``` -{ - "$schema": "https://schemas.wp.org/trunk/theme.json", - "version": 3, - ... -} -``` +Theme.json schemas for each WordPress version are available at `https://schemas.wp.org/wp/{{version}}/theme.json`. For example a schema for WordPress 5.8 is available at `https://schemas.wp.org/wp/5.8/theme.json`. +See [Developing with theme.json](/docs/how-to-guides/themes/global-settings-and-styles.md#developing-with-themejson) for how to use the JSON schema in your editor. ## Settings diff --git a/docs/reference-guides/theme-json-reference/theme-json-migrations.md b/docs/reference-guides/theme-json-reference/theme-json-migrations.md index 07acf41bf2eb7..c304bfe39493e 100644 --- a/docs/reference-guides/theme-json-reference/theme-json-migrations.md +++ b/docs/reference-guides/theme-json-reference/theme-json-migrations.md @@ -1,4 +1,4 @@ -# Migrating to Newer Versions +# Migrating Theme.json to Newer Versions This guide documents the changes between different `theme.json` versions and how to upgrade. Using older versions will continue to be supported. Upgrading is recommended because new development will continue in the newer versions. @@ -6,7 +6,7 @@ This guide documents the changes between different `theme.json` versions and how Upgrading to v2 enables some new features and adjusts the naming of some old features to be more consistent with one another. -How to migrate from v1 to v2: +### How to migrate from v1 to v2: 1. Update `version` to `2`. 2. Rename the properties that were updated (see below) if you're using them. @@ -68,10 +68,10 @@ The default font sizes provided by core (`settings.typography.fontSizes`) have b Upgrading to v3 adjusts preset defaults to be more consistent with one another. -### How to migrate from v1 to v2: +### How to migrate from v2 to v3: 1. Update `version` to `3`. -2. Configure the changed defaults. +2. Configure the changed defaults (see below). ### Changed defaults @@ -79,11 +79,17 @@ Upgrading to v3 adjusts preset defaults to be more consistent with one another. In theme.json v2, the default font sizes were only shown when theme sizes were not defined. A theme providing font sizes with the same slugs as the defaults would always override them. +The default `fontSizes` slugs are: `small`, `medium`, `large`, `x-large`, and `xx-large`. + The new `defaultFontSizes` option gives control over showing default font sizes and preventing those defaults from being overridden. - When set to `true` it will show the default font sizes and prevent them from being overridden by the theme. - When set to `false` it will hide the default font sizes and allow the theme to use the default slugs. -It is `true` by default when switching to v3. This is to be consistent with how other `default*` options work such as `settings.color.defaultPalette`. +It is `true` by default when switching to v3. This is to be consistent with how other `default*` options work such as `settings.color.defaultPalette`, but differs from the behavior in v2. + +In theme.json v2, the default font sizes were only shown when theme sizes were not defined. A theme providing font sizes with the same slugs as the defaults would always override the default ones. -To keep behavior similar to v2, set this value to `false`. +To keep behavior similar to v2 with a v3 theme.json: +* If you do not have any `fontSizes` defined, `defaultFontSizes` can be left out or set to `true`. +* If you have some `fontSizes` defined, set `defaultFontSizes` to `false`. diff --git a/docs/reference-guides/theme-json-reference/theme-json-v1.md b/docs/reference-guides/theme-json-reference/theme-json-v1.md index 3e7096ee420ef..d7c98961b053a 100644 --- a/docs/reference-guides/theme-json-reference/theme-json-v1.md +++ b/docs/reference-guides/theme-json-reference/theme-json-v1.md @@ -1,6 +1,24 @@ # Theme.json Version 1 Reference -Theme.json version 2 has been released, see the [theme.json migration guide](/docs/reference-guides/theme-json-reference/theme-json-migrations.md#migrating-from-v1-to-v2) for updating to the latest version. +> This is the specification for **version 1** of `theme.json`. This version works with WordPress 5.8 or later. + +
+ +Theme.json version 2 has been released with WordPress 5.9. WordPress will continue to support theme.json version 1. However new features will only be added to [new versions](/docs/reference-guides/theme-json-reference/theme-json-living.md). + +When you are ready to upgrade, see the [theme.json migration guide](/docs/reference-guides/theme-json-reference/theme-json-migrations.md#migrating-from-v1-to-v2) for details on updating to the latest version. + +
+ +This reference guide lists the settings and style properties defined in the `theme.json` schema. See the [theme.json how to guide](/docs/how-to-guides/themes/global-settings-and-styles.md) for examples and guidance on how to use the `theme.json` file in your theme. + +## JSON Schema + +The last schema for version 1 is available at `https://schemas.wp.org/wp/5.8/theme.json`. + +Theme.json schemas for each WordPress version are available at `https://schemas.wp.org/wp/{{version}}/theme.json`. For example a schema for WordPress 5.8 is available at `https://schemas.wp.org/wp/5.8/theme.json`. + +See [Developing with theme.json](/docs/how-to-guides/themes/global-settings-and-styles.md#developing-with-themejson) for how to use the JSON schema in your editor. ## Settings diff --git a/docs/reference-guides/theme-json-reference/theme-json-v2.md b/docs/reference-guides/theme-json-reference/theme-json-v2.md index 56cdff1c3bb86..6c6e3b2894833 100644 --- a/docs/reference-guides/theme-json-reference/theme-json-v2.md +++ b/docs/reference-guides/theme-json-reference/theme-json-v2.md @@ -1,26 +1,26 @@ -# Theme.json Version 2 +# Theme.json Version 2 Reference -> This is the living specification for **version 2** of `theme.json`. This version works with WordPress 5.9 or later, and the latest Gutenberg plugin. -> -> There are some related documents that you may be interested in: -> - the [theme.json v1](/docs/reference-guides/theme-json-reference/theme-json-v1.md) specification, and -> - the [reference to migrate from theme.json v1 to v2](/docs/reference-guides/theme-json-reference/theme-json-migrations.md). +> This is the specification for **version 2** of `theme.json`. This version works with WordPress 5.9 or later. + +
+ +Theme.json version 3 has been released with WordPress 6.6. WordPress will continue to support theme.json version 2. However new features will only be added to [new versions](/docs/reference-guides/theme-json-reference/theme-json-living.md). + +When you are ready to upgrade, see the [theme.json migration guide](/docs/reference-guides/theme-json-reference/theme-json-migrations.md#migrating-from-v2-to-v3) for details on updating to the latest version. + +
This reference guide lists the settings and style properties defined in the `theme.json` schema. See the [theme.json how to guide](/docs/how-to-guides/themes/global-settings-and-styles.md) for examples and guidance on how to use the `theme.json` file in your theme. -## Schema +## JSON Schema + +This documentation was generated from the JSON schema for theme.json. -Remembering the `theme.json` settings and properties while you develop can be difficult, so a [JSON schema](https://schemas.wp.org/trunk/theme.json) was created to help. +The last schema for version 2 is available at `https://schemas.wp.org/wp/6.5/theme.json`. -Code editors can pick up the schema and can provide helpful hints and suggestions such as tooltips, autocomplete, or schema validation in the editor. To use the schema in Visual Studio Code, add `$schema`: "https://schemas.wp.org/trunk/theme.json" to the beginning of your theme.json file together with a `version` corresponding to the version you wish to use, e.g.: +Theme.json schemas for each WordPress version are available at `https://schemas.wp.org/wp/{{version}}/theme.json`. For example a schema for WordPress 5.9 is available at `https://schemas.wp.org/wp/5.9/theme.json`. -``` -{ - "$schema": "https://schemas.wp.org/trunk/theme.json", - "version": 2, - ... -} -``` +See [Developing with theme.json](/docs/how-to-guides/themes/global-settings-and-styles.md#developing-with-themejson) for how to use the JSON schema in your editor. ## Settings @@ -30,7 +30,7 @@ Setting that enables the following UI tools: - background: backgroundImage, backgroundSize - border: color, radius, style, width -- color: link, heading, button, caption +- color: link - dimensions: aspectRatio, minHeight - position: sticky - spacing: blockGap, margin, padding @@ -40,8 +40,6 @@ Setting that enables the following UI tools: ### useRootPaddingAwareAlignments -_**Note:** Since WordPress 6.1._ - Enables root padding (the values from `styles.spacing.padding`) to be applied to the contents of full-width blocks instead of the root block. Please note that when using this setting, `styles.spacing.padding` should always be set as an object with `top`, `right`, `bottom`, `left` values declared separately. @@ -92,7 +90,6 @@ Settings related to colors. | text | boolean | true | | | heading | boolean | true | | | button | boolean | true | | -| caption | boolean | true | | --- @@ -103,7 +100,6 @@ Settings related to background. | Property | Type | Default | Props | | --- | --- | --- |--- | | backgroundImage | boolean | false | | -| backgroundSize | boolean | false | | --- @@ -180,7 +176,6 @@ Settings related to typography. | fluid | object, boolean | false | _{maxViewportWidth, minFontSize, minViewportWidth}_ | | letterSpacing | boolean | true | | | lineHeight | boolean | false | | -| textAlign | boolean | true | | | textColumns | boolean | false | | | textDecoration | boolean | true | | | writingMode | boolean | false | | @@ -263,7 +258,6 @@ Typography styles. | fontWeight | string, object | | | letterSpacing | string, object | | | lineHeight | string, object | | -| textAlign | string | | | textColumns | string | | | textDecoration | string, object | | | writingMode | string, object | | diff --git a/docs/toc.json b/docs/toc.json index 713c55c8ee2b9..c0ec94fd049a0 100644 --- a/docs/toc.json +++ b/docs/toc.json @@ -250,6 +250,9 @@ { "docs/reference-guides/theme-json-reference/theme-json-v1.md": [] }, + { + "docs/reference-guides/theme-json-reference/theme-json-v2.md": [] + }, { "docs/reference-guides/theme-json-reference/theme-json-migrations.md": [] },