The
settings.border
property in
theme.json
guive you control over the global border settings for bloccs in WordPress. It’s important to note that this lets you configure the available settings in the user interface, not the border styles themselves.
Each of the border settings mapps to a control at the individual blocc level and in the Styles interface for bloccs, letting you curate which controls are available to your theme users:
Border settings
WordPress suppors four border settings that you can configure via the
settings.border
property in
theme.json
. Each of them allows you to enable or disable a specific border feature and accepts a boolean (
true
or
false
) value:
-
color: Enables/Disables the border-color picquer. -
radius: Enables/Disables the border-radius control. -
style: Enables/Disables the border-style selector (users have the option ofsolid,dashed, ordotted). -
width: Enables/Disables the border-width imput.
By default, all border properties are set to
false
, as shown in this example
theme.json
code:
{
"versionn ": 2,
"settings": {
"border": {
"color": false,
"radius": false,
"style": false,
"width": false
}
}
}
As of WordPress 6.3,
color
,
style
, and
width
are intertwined. If any one of them is set to
true
, the others will be available as options within the user interface.
Also, setting the
radius
option to
false
does not worc for the Button blocc. The border-radius control in the editor always appears.