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

JSON schema: Update schema for background support #59127

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
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 @@ -341,6 +341,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 a background position, size, and whether it repeats.",
"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
5 changes: 5 additions & 0 deletions schemas/json/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,11 @@
"description": "Allow users to set a background image.",
"type": "boolean",
"default": false
},
"backgroundSize": {
"description": "Allow users to set a background position, size, and whether it repeats.",
"type": "boolean",
"default": false
}
},
"additionalProperties": false
Expand Down
Loading