これは
theme.jsonバージョン 1の仕様です。このバージョンは WordPress 5.8以降で動作します。
theme.json バージョン 2が WordPress 5.9でリリースされました。WordPress は 引き続き theme.json version 1をサポートしますが、新機能は 新しいバージョン にのみ追加されます。
アップグレードの準備ができたら、theme.json 移行ガイド で最新版へのアップデートの詳細を参照してください。
このリファレンスガイドでは theme.json スキーマで定義されている設定とスタイルのプロパティを列挙します。テーマで theme.json ファイルを使用する方法については、theme.json 利用ガイドを参照してください。
JSON スキーマ
バージョン1の最後のスキーマは https://schemas.wp.org/wp/5.8/theme.json にあります。
各 WordPress バージョンの theme.json スキーマは、https://schemas.wp.org/wp/{{version}}/theme.json から利用できます。例えば、WordPress 5.8用のスキーマは https://schemas.wp.org/wp/5.8/theme.json にあります。
お使いのエディターで JSON スキーマを使用する方法については theme.json を使用した開発を参照してください。
settings
border
ボーダー関連の設定です。
| Property | Type | Default | Props |
|---|---|---|---|
| customRadius | boolean | false |
color
色関連の設定です。
| Property | Type | Default | Props |
|---|---|---|---|
| custom | boolean | true | |
| customDuotone | boolean | true | |
| customGradient | boolean | true | |
| duotone | array | colors, name, slug | |
| gradients | array | gradient, name, slug | |
| link | boolean | false | |
| palette | array | color, name, slug |
layout
レイアウト関連の設定です。
| Property | Type | Default | Props |
|---|---|---|---|
| contentSize | string | ||
| wideSize | string |
spacing
スペース関連の設定です。
| Property | Type | Default | Props |
|---|---|---|---|
| customMargin | boolean | false | |
| customPadding | boolean | false | |
| units | array | px,em,rem,vh,vw,% |
typography
タイポグラフィ関連の設定です。
| Property | Type | Default | Props |
|---|---|---|---|
| customFontSize | boolean | true | |
| customLineHeight | boolean | false | |
| dropCap | boolean | true | |
| fontSizes | array | name, size, slug |
custom
「--wp--custom--{key}--{nested-key}: {value};」形式のカスタム CSS カスタムプロパティを生成します。camelCased のキーは、CSSプロパティ命名スキーマに従うために、 kebab-case に変換されます。異なる深さのレベルのキーは -- で区切られるため、キーの名前に -- を含めないでください。
styles
border
ボーダーのスタイル。
| Property | Type | Props |
|---|---|---|
| radius | string |
color
色のスタイル。
| Property | Type | Props |
|---|---|---|
| background | string | |
| gradient | string | |
| text | string |
spacing
スペースのスタイル。
| Property | Type | Props |
|---|---|---|
| margin | object | bottom, left, right, top |
| padding | object | bottom, left, right, top |
typography
タイポグラフィのスタイル。
| Property | Type | Props |
|---|---|---|
| fontSize | string | |
| lineHeight | string |