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 768103bf39ebe1..189fe6d2f01a06 100644 --- a/docs/reference-guides/theme-json-reference/theme-json-living.md +++ b/docs/reference-guides/theme-json-reference/theme-json-living.md @@ -31,7 +31,7 @@ Code editors can pick up the schema and can provide helpful hints and suggestion Setting that enables the following UI tools: -- background: backgroundImage +- background: backgroundImage, backgroundSize - border: color, radius, style, width - color: link - dimensions: aspectRatio, minHeight @@ -72,7 +72,7 @@ Settings related to shadows. | Property | Type | Default | Props | | --- | --- | --- |--- | -| defaultPresets | boolean | false | | +| defaultPresets | boolean | true | | | presets | array | | name, shadow, slug | --- @@ -107,6 +107,7 @@ Settings related to background. | Property | Type | Default | Props | | --- | --- | --- |--- | | backgroundImage | boolean | false | | +| backgroundSize | boolean | false | | --- diff --git a/schemas/json/block.json b/schemas/json/block.json index 7234f36a5e0ecb..31f7ae42f83b2d 100644 --- a/schemas/json/block.json +++ b/schemas/json/block.json @@ -346,6 +346,22 @@ } } }, + "background": { + "type": "object", + "description": "This value signals that a block supports some of the CSS style properties related to background. When it does, the block editor will show UI controls for the user to set their values if the theme declares support.\n\nWhen the block declares support for a specific background property, its attributes definition is extended to include the style attribute.", + "properties": { + "backgroundImage": { + "type": "boolean", + "description": "Allow blocks to define a background image.", + "default": false + }, + "backgroundSize": { + "type": "boolean", + "description": "Allow blocks to define values related to the size of a background image, including size, position, and repeat controls", + "default": false + } + } + }, "html": { "type": "boolean", "description": "By default, a block’s markup can be edited individually. To disable this behavior, set html to false.", diff --git a/schemas/json/theme.json b/schemas/json/theme.json index 08e5c7eb5ae068..a5b54de97ed70f 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -20,7 +20,7 @@ "type": "object", "properties": { "appearanceTools": { - "description": "Setting that enables the following UI tools:\n\n- background: backgroundImage\n- border: color, radius, style, width\n- color: link\n- dimensions: aspectRatio, minHeight\n- position: sticky\n- spacing: blockGap, margin, padding\n- typography: lineHeight", + "description": "Setting that enables the following UI tools:\n\n- background: backgroundImage, backgroundSize\n- border: color, radius, style, width\n- color: link\n- dimensions: aspectRatio, minHeight\n- position: sticky\n- spacing: blockGap, margin, padding\n- typography: lineHeight", "type": "boolean", "default": false } @@ -77,7 +77,7 @@ "defaultPresets": { "description": "Allow users to choose shadows from the default shadow presets.", "type": "boolean", - "default": false + "default": true }, "presets": { "description": "Shadow presets for the shadow picker.\nGenerates a single custom property (`--wp--preset--shadow--{slug}`) per preset value.", @@ -258,6 +258,11 @@ "description": "Allow users to set a background image.", "type": "boolean", "default": false + }, + "backgroundSize": { + "description": "Allow users to set values related to the size of a background image, including size, position, and repeat controls.", + "type": "boolean", + "default": false } }, "additionalProperties": false