Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport missing changes to WP 6.5 schema and docs #61264

Open
wants to merge 6 commits into
base: wp/6.5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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