Skip to content

Commit

Permalink
Backport missing changes to WP 6.5 schema and docs (#61264)
Browse files Browse the repository at this point in the history
* Add backgroundSize setting

* Fix default shadow defaultPrests

* Update docs

* Update appearanceTools description

* Fix block.json schema

Co-authored-by: ajlende <ajlende@git.wordpress.org>
Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>
  • Loading branch information
3 people authored Jul 22, 2024
1 parent ec93880 commit c94ce8b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -72,7 +72,7 @@ Settings related to shadows.

| Property | Type | Default | Props |
| --- | --- | --- |--- |
| defaultPresets | boolean | false | |
| defaultPresets | boolean | true | |
| presets | array | | name, shadow, slug |

---
Expand Down Expand Up @@ -107,6 +107,7 @@ Settings related to background.
| Property | Type | Default | Props |
| --- | --- | --- |--- |
| backgroundImage | boolean | false | |
| backgroundSize | boolean | false | |

---

Expand Down
16 changes: 16 additions & 0 deletions schemas/json/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
9 changes: 7 additions & 2 deletions schemas/json/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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.",
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c94ce8b

Please sign in to comment.