From 84ecd64d21b51345fcb2b0bfcda793a116fd5ef9 Mon Sep 17 00:00:00 2001 From: Alex Lende Date: Tue, 30 Apr 2024 12:33:51 -0500 Subject: [PATCH 1/5] Add backgroundSize setting --- schemas/json/theme.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/schemas/json/theme.json b/schemas/json/theme.json index 08e5c7eb5ae068..e0958c6a7c2c0a 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -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 From fed4b2f49cbb9fa96c2288edabd8fadb5f72f919 Mon Sep 17 00:00:00 2001 From: Alex Lende Date: Tue, 30 Apr 2024 15:26:39 -0500 Subject: [PATCH 2/5] Fix default shadow defaultPrests --- schemas/json/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/json/theme.json b/schemas/json/theme.json index e0958c6a7c2c0a..982b503b4b9cf7 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -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.", From 67362b6186d422975a541af820db8e2ef5ebc47c Mon Sep 17 00:00:00 2001 From: Alex Lende Date: Tue, 30 Apr 2024 15:28:26 -0500 Subject: [PATCH 3/5] Update docs --- .../reference-guides/theme-json-reference/theme-json-living.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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..754d0c50caac83 100644 --- a/docs/reference-guides/theme-json-reference/theme-json-living.md +++ b/docs/reference-guides/theme-json-reference/theme-json-living.md @@ -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 | | --- From eb730f51c6fdb58f79ff16fb6de6a7339a0b6a1c Mon Sep 17 00:00:00 2001 From: Alex Lende Date: Tue, 30 Apr 2024 15:37:02 -0500 Subject: [PATCH 4/5] Update appearanceTools description --- docs/reference-guides/theme-json-reference/theme-json-living.md | 2 +- schemas/json/theme.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 754d0c50caac83..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 diff --git a/schemas/json/theme.json b/schemas/json/theme.json index 982b503b4b9cf7..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 } From cfd23583381a86da10e0b5a94fc64603884c5528 Mon Sep 17 00:00:00 2001 From: Alex Lende Date: Tue, 30 Apr 2024 16:08:06 -0500 Subject: [PATCH 5/5] Fix block.json schema --- schemas/json/block.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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.",