Skip to content

Commit

Permalink
theme.json schema: fix styles.background definition (#59595)
Browse files Browse the repository at this point in the history
* theme.json schema: fix `styles.background` definition

* Update doc

Co-authored-by: t-hamano <[email protected]>
Co-authored-by: ramonjd <[email protected]>
  • Loading branch information
3 people authored Mar 6, 2024
1 parent 131f81b commit cabc0c7
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 81 deletions.
13 changes: 0 additions & 13 deletions docs/reference-guides/theme-json-reference/theme-json-living.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,19 +204,6 @@ Generate custom CSS custom properties of the form `--wp--custom--{key}--{nested-
## Styles


### background

Background styles

| Property | Type | Props |
| --- | --- |--- |
| backgroundImage | string, object | |
| backgroundPosition | string, object | |
| backgroundRepeat | string, object | |
| backgroundSize | string, object | |

---

### border

Border styles.
Expand Down
136 changes: 68 additions & 68 deletions schemas/json/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -1110,74 +1110,6 @@
"stylesProperties": {
"type": "object",
"properties": {
"background": {
"description": "Background styles",
"type": "object",
"properties": {
"backgroundImage": {
"description": "Sets the `background-image` CSS property.",
"oneOf": [
{
"description": "A valid CSS value for the background-image property.",
"type": "string"
},
{
"type": "object",
"properties": {
"source": {
"description": "The origin of the image. 'file' denotes that the 'url' is a path to an image or other file.",
"type": "string",
"enum": [ "file" ],
"default": "file"
},
"url": {
"description": "A URL to an image file.",
"type": "string"
}
},
"additionalProperties": false
},
{
"$ref": "#/definitions/refComplete"
}
]
},
"backgroundPosition": {
"description": "Sets the `background-position` CSS property.",
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/refComplete"
}
]
},
"backgroundRepeat": {
"description": "Sets the `background-repeat` CSS property.",
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/refComplete"
}
]
},
"backgroundSize": {
"description": "Sets the `background-size` CSS property.",
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/refComplete"
}
]
}
},
"additionalProperties": false
},
"border": {
"description": "Border styles.",
"type": "object",
Expand Down Expand Up @@ -2365,6 +2297,74 @@
"blocks": {
"description": "Styles defined on a per-block basis using the block's selector.",
"$ref": "#/definitions/stylesBlocksPropertiesComplete"
},
"background": {
"description": "Background styles.",
"type": "object",
"properties": {
"backgroundImage": {
"description": "Sets the `background-image` CSS property.",
"oneOf": [
{
"description": "A valid CSS value for the background-image property.",
"type": "string"
},
{
"type": "object",
"properties": {
"source": {
"description": "The origin of the image. 'file' denotes that the 'url' is a path to an image or other file.",
"type": "string",
"enum": [ "file" ],
"default": "file"
},
"url": {
"description": "A URL to an image file.",
"type": "string"
}
},
"additionalProperties": false
},
{
"$ref": "#/definitions/refComplete"
}
]
},
"backgroundPosition": {
"description": "Sets the `background-position` CSS property.",
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/refComplete"
}
]
},
"backgroundRepeat": {
"description": "Sets the `background-repeat` CSS property.",
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/refComplete"
}
]
},
"backgroundSize": {
"description": "Sets the `background-size` CSS property.",
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/refComplete"
}
]
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand Down

0 comments on commit cabc0c7

Please sign in to comment.