本文档是 theme.json 中 settings 对象可配置属性的参考指南,涵盖外观工具、边框、颜色、自定义、尺寸、布局、灯箱、位置、阴影、间距、排版和根填充感知对齐等设置。每个设置都有详细的文档链接。
The document is a reference to the available settings properties that you can configure via the settings object in theme.json. Each of the settings has an in-depth guide on how to use it within the Settings documentation.
settings.appearanceTools is a top-level property with no sub-properties nested beneath it. It is documented at Settings: Appearance Tools.
| Property | Type | Default |
|---|---|---|
appearanceTools |
boolean | false |
settings.border is an object that supports the nested properties listed in the below table. It is documented at Settings: Border.
| Property | Type | Default |
|---|---|---|
color |
boolean | false |
radius |
boolean | false |
style |
boolean | false |
width |
boolean | false |
Enabling any one of the color, style, or width settings will automatically enable the other two since the properties are linked together.
settings.color is an object that supports the nested properties listed in the below table. It is documented at Settings: Color.
| Property | Type | Default | Props |
|---|---|---|---|
background |
boolean | true |
— |
custom |
boolean | true |
— |
customDuotone |
boolean | true |
— |
customGradient |
boolean | true |
— |
defaultDuotone |
boolean | true |
— |
defaultGradients |
boolean | true |
— |
defaultPalette |
boolean | true |
— |
duotone |
array <object> | array |
colors, name, slug |
gradients |
array <object> | array |
gradient, name, slug |
link |
boolean | false |
— |
palette |
array <object> | array |
color, name, slug |
text |
boolean | true |
— |
settings.custom is an object that supports any number of nested custom properties, as shown in the below table. It is documented at Settings: Custom.
| Property | Type | Default |
|---|---|---|
custom.<custom> |
any | — |
settings.dimensions is an object that supports the nested properties listed in the below table. It is documented at Settings: Dimensions.
| Property | Type | Default |
|---|---|---|
minHeight |
boolean | false |
settings.layout is an object that supports the nested properties listed in the below table. It is documented at Settings: Layout.
| Property | Type | Default |
|---|---|---|
contentSize |
string | "" |
wideSize |
string | "" |
settings.lightbox is an object that supports the nested properties listed in the below table. It is documented at Settings: Lightbox.
| Property | Type | Default |
|---|---|---|
allowEditing |
boolean | true |
enabled |
boolean | false |
This setting is only available as of WordPress 6.4 and is specific to the core Image block (core/image).
settings.position is an object that supports the nested properties listed in the below table. It is documented at Settings: Position.
| Property | Type | Default |
|---|---|---|
sticky |
boolean | false |
settings.shadow is an object that supports the nested properties listed in the below table. It is documented at Settings: Shadow.
| Property | Type | Default | Props |
|---|---|---|---|
defaultPresets |
boolean | true |
|
presets |
array <object> | array |
name, shadow, slug |
settings.spacing is an object that supports the nested properties listed in the below table. It is documented at Settings: Spacing.
| Property | Type | Default | Props |
|---|---|---|---|
blockGap |
boolean|null | null |
— |
customSpacingSize |
boolean | true |
— |
margin |
boolean | false |
— |
padding |
boolean | false |
— |
spacingScale |
object | object |
operator, increment, steps, mediumStep, unit |
spacingSizes |
array <object> | array |
name, size, slug |
units |
array <string> | [ "px", "em", "rem", "vh", "vw", "%" ] |
— |
settings.typography is an object that supports the nested properties listed in the below table. It is documented at Settings: Typography.
| Property | Type | Default | Props |
|---|---|---|---|
customFontSize |
boolean | true |
— |
dropCap |
boolean | true |
— |
fontFamilies |
array <object> | array |
fontFace, fontFamily, name, slug |
fontSizes |
array <object> | array |
fluid, name, size, slug |
fontStyle |
boolean | true |
— |
fontWeight |
boolean | true |
— |
fluid |
boolean | false |
— |
letterSpacing |
boolean | true |
— |
lineHeight |
boolean | false |
— |
textColumns |
boolean | false |
— |
textDecoration |
boolean | true |
— |
textTransform |
boolean | true |
— |
writingMode |
boolean | false |
— |
settings.useRootPaddingAwareAlignments is a top-level property with no sub-properties nested beneath it. It is documented at Settings: Use Root Padding Aware Alignments.
| Property | Type | Default |
|---|---|---|
useRootPaddingAwareAlignments |
boolean | false |
This setting works together with styles.spacing.padding in theme.json. If enabled, styles.spacing.padding must be an object that defines the top, right, bottom, and left styles separately.