From ae29bdee858feca7881921bd3383f50e6a95e098 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Fri, 18 Nov 2022 11:01:20 +0000 Subject: [PATCH 01/11] Allow objects on color properties --- schemas/json/theme.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/schemas/json/theme.json b/schemas/json/theme.json index d42706bec8df9..b742e3f5533d0 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -1023,15 +1023,15 @@ "properties": { "background": { "description": "Sets the `background-color` CSS property.", - "type": "string" + "type": [ "string", "object" ] }, "gradient": { "description": "Sets the `background` CSS property.", - "type": "string" + "type": [ "string", "object" ] }, "text": { "description": "Sets the `color` CSS property.", - "type": "string" + "type": [ "string", "object" ] } }, "additionalProperties": false From d1a0d8e66bedfe0facaec6de02ec61d148d58876 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Fri, 18 Nov 2022 11:53:29 +0000 Subject: [PATCH 02/11] Add definition for ref property --- schemas/json/theme.json | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/schemas/json/theme.json b/schemas/json/theme.json index b742e3f5533d0..1ad0cacf8598b 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -1023,15 +1023,45 @@ "properties": { "background": { "description": "Sets the `background-color` CSS property.", - "type": [ "string", "object" ] + "oneOf": [ + { "type": "string" }, + { "type": "object" } + ], + "properties": { + "ref": { + "description": "A reference to another property value. e.g. `styles.color.text`", + "type": "string" + } + }, + "additionalProperties": false }, "gradient": { "description": "Sets the `background` CSS property.", - "type": [ "string", "object" ] + "oneOf": [ + { "type": "string" }, + { "type": "object" } + ], + "properties": { + "ref": { + "description": "A reference to another property value. e.g. `styles.color.text`", + "type": "string" + } + }, + "additionalProperties": false }, "text": { "description": "Sets the `color` CSS property.", - "type": [ "string", "object" ] + "oneOf": [ + { "type": "string" }, + { "type": "object" } + ], + "properties": { + "ref": { + "description": "A reference to another property value. e.g. `styles.color.text`", + "type": "string" + } + }, + "additionalProperties": false } }, "additionalProperties": false From 6096487af50fef694b28a49803ef27b4f68a7d96 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Fri, 18 Nov 2022 14:07:25 +0000 Subject: [PATCH 03/11] Reduce repetition in property definitions --- schemas/json/theme.json | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/schemas/json/theme.json b/schemas/json/theme.json index 1ad0cacf8598b..15420b4553a37 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -1041,12 +1041,7 @@ { "type": "string" }, { "type": "object" } ], - "properties": { - "ref": { - "description": "A reference to another property value. e.g. `styles.color.text`", - "type": "string" - } - }, + "$ref": "#/definitions/stylesProperties/properties/color/properties/background/properties", "additionalProperties": false }, "text": { @@ -1055,12 +1050,7 @@ { "type": "string" }, { "type": "object" } ], - "properties": { - "ref": { - "description": "A reference to another property value. e.g. `styles.color.text`", - "type": "string" - } - }, + "$ref": "#/definitions/stylesProperties/properties/color/properties/background/properties", "additionalProperties": false } }, From b9148743e91beaa52a612fa85e9c24ec7b915cc9 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Mon, 21 Nov 2022 11:11:57 +0000 Subject: [PATCH 04/11] Move properties def to oneOf array --- schemas/json/theme.json | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/schemas/json/theme.json b/schemas/json/theme.json index 15420b4553a37..959886411c027 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -1025,33 +1025,33 @@ "description": "Sets the `background-color` CSS property.", "oneOf": [ { "type": "string" }, - { "type": "object" } - ], - "properties": { - "ref": { - "description": "A reference to another property value. e.g. `styles.color.text`", - "type": "string" + { + "type": "object", + "properties": { + "ref": { + "description": "A reference to another property value. e.g. `styles.color.text`", + "type": "string" + } + }, + "additionalProperties": false } - }, - "additionalProperties": false + ] }, "gradient": { "description": "Sets the `background` CSS property.", "oneOf": [ - { "type": "string" }, - { "type": "object" } - ], - "$ref": "#/definitions/stylesProperties/properties/color/properties/background/properties", - "additionalProperties": false + { + "$ref": "#/definitions/stylesProperties/properties/color/properties/background/properties/oneOf" + } + ] }, "text": { "description": "Sets the `color` CSS property.", "oneOf": [ - { "type": "string" }, - { "type": "object" } - ], - "$ref": "#/definitions/stylesProperties/properties/color/properties/background/properties", - "additionalProperties": false + { + "$ref": "#/definitions/stylesProperties/properties/color/properties/background/properties/oneOf" + } + ] } }, "additionalProperties": false From 7992e54796166fb8ed9b3ef79d6038277adff171 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Mon, 21 Nov 2022 11:21:17 +0000 Subject: [PATCH 05/11] Fix $ref path --- schemas/json/theme.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/schemas/json/theme.json b/schemas/json/theme.json index 959886411c027..0e89fecef1b5b 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -1024,7 +1024,6 @@ "background": { "description": "Sets the `background-color` CSS property.", "oneOf": [ - { "type": "string" }, { "type": "object", "properties": { @@ -1034,14 +1033,15 @@ } }, "additionalProperties": false - } + }, + { "type": "string" } ] }, "gradient": { "description": "Sets the `background` CSS property.", "oneOf": [ { - "$ref": "#/definitions/stylesProperties/properties/color/properties/background/properties/oneOf" + "$ref": "#/definitions/stylesProperties/properties/color/properties/background/oneOf" } ] }, @@ -1049,7 +1049,7 @@ "description": "Sets the `color` CSS property.", "oneOf": [ { - "$ref": "#/definitions/stylesProperties/properties/color/properties/background/properties/oneOf" + "$ref": "#/definitions/stylesProperties/properties/color/properties/background/oneOf" } ] } From 0fd839bca43edf4a31038f8ed7013004d4c6b941 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Mon, 21 Nov 2022 12:16:39 +0000 Subject: [PATCH 06/11] Move ref def to global scope --- schemas/json/theme.json | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/schemas/json/theme.json b/schemas/json/theme.json index 0e89fecef1b5b..d99be5478da1c 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -7,6 +7,15 @@ "createTheme": "https://developer.wordpress.org/block-editor/how-to-guides/themes/create-block-theme/", "reference": "https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/" }, + "refComplete": { + "type": "object", + "properties": { + "ref": { + "description": "A reference to another property value. e.g. `styles.color.text`", + "type": "string" + } + } + }, "settingsPropertiesAppearanceTools": { "type": "object", "properties": { @@ -1025,23 +1034,21 @@ "description": "Sets the `background-color` CSS property.", "oneOf": [ { - "type": "object", - "properties": { - "ref": { - "description": "A reference to another property value. e.g. `styles.color.text`", - "type": "string" - } - }, - "additionalProperties": false + "type": "string" }, - { "type": "string" } + { + "$ref": "#/definitions/refComplete" + } ] }, "gradient": { "description": "Sets the `background` CSS property.", "oneOf": [ { - "$ref": "#/definitions/stylesProperties/properties/color/properties/background/oneOf" + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" } ] }, @@ -1049,7 +1056,10 @@ "description": "Sets the `color` CSS property.", "oneOf": [ { - "$ref": "#/definitions/stylesProperties/properties/color/properties/background/oneOf" + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" } ] } From 59744608d8888fa96c0cc3d21e18560be05f0bc1 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Mon, 21 Nov 2022 15:10:14 +0000 Subject: [PATCH 07/11] Apply ref type to all style properties --- schemas/json/theme.json | 381 +++++++++++++++++++++++++++++++++++----- 1 file changed, 339 insertions(+), 42 deletions(-) diff --git a/schemas/json/theme.json b/schemas/json/theme.json index d99be5478da1c..c19a7db7d893d 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -912,7 +912,14 @@ "properties": { "color": { "description": "Sets the `border-color` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "radius": { "description": "Sets the `border-radius` CSS property.", @@ -920,24 +927,55 @@ { "type": "string" }, + { + "$ref": "#/definitions/refComplete" + }, { "type": "object", "properties": { "topLeft": { "description": "Sets the `border-top-left-radius` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "topRight": { "description": "Sets the `border-top-right-radius` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "bottomLeft": { "description": "Sets the `border-bottom-left-radius` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "bottomRight": { "description": "Sets the `border-bottom-right-radius` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] } } } @@ -945,26 +983,61 @@ }, "style": { "description": "Sets the `border-style` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "width": { "description": "Sets the `border-width` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "top": { "type": "object", "properties": { "color": { "description": "Sets the `border-top-color` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "style": { "description": "Sets the `border-top-style` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "width": { "description": "Sets the `border-top-width` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] } }, "additionalProperties": false @@ -974,15 +1047,36 @@ "properties": { "color": { "description": "Sets the `border-right-color` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "style": { "description": "Sets the `border-right-style` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "width": { "description": "Sets the `border-right-width` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] } }, "additionalProperties": false @@ -992,15 +1086,36 @@ "properties": { "color": { "description": "Sets the `border-bottom-color` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "style": { "description": "Sets the `border-bottom-style` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "width": { "description": "Sets the `border-bottom-width` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] } }, "additionalProperties": false @@ -1010,15 +1125,36 @@ "properties": { "color": { "description": "Sets the `border-left-color` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "style": { "description": "Sets the `border-left-style` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "width": { "description": "Sets the `border-left-width` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] } }, "additionalProperties": false @@ -1072,7 +1208,14 @@ "properties": { "blockGap": { "description": "Sets the `--wp--style--block-gap` CSS custom property when settings.spacing.blockGap is true.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "margin": { "description": "Margin styles.", @@ -1080,19 +1223,47 @@ "properties": { "top": { "description": "Sets the `margin-top` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "right": { "description": "Sets the `margin-right` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "bottom": { "description": "Sets the `margin-bottom` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "left": { "description": "Sets the `margin-left` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] } }, "additionalProperties": false @@ -1103,19 +1274,47 @@ "properties": { "top": { "description": "Sets the `padding-top` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "right": { "description": "Sets the `padding-right` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "bottom": { "description": "Sets the `padding-bottom` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "left": { "description": "Sets the `padding-left` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] } }, "additionalProperties": false @@ -1129,35 +1328,91 @@ "properties": { "fontFamily": { "description": "Sets the `font-family` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "fontSize": { "description": "Sets the `font-size` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "fontStyle": { "description": "Sets the `font-style` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "fontWeight": { "description": "Sets the `font-weight` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "letterSpacing": { "description": "Sets the `letter-spacing` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "lineHeight": { "description": "Sets the `line-height` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "textDecoration": { "description": "Sets the `text-decoration` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "textTransform": { "description": "Sets the `text-transform` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] } }, "additionalProperties": false @@ -1168,14 +1423,28 @@ "properties": { "duotone": { "description": "Sets the duotone filter.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] } }, "additionalProperties": false }, "shadow": { "description": "Box shadow styles.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "outline": { "description": "Outline styles.", @@ -1183,19 +1452,47 @@ "properties": { "color": { "description": "Sets the `outline-color` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "offset": { "description": "Sets the `outline-offset` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "style": { "description": "Sets the `outline-style` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] }, "width": { "description": "Sets the `outline-width` CSS property.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/refComplete" + } + ] } }, "additionalProperties": false From 1441c4e38de1eda6719f8845c15d24ca6b905e9a Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Mon, 21 Nov 2022 15:26:34 +0000 Subject: [PATCH 08/11] Update docs --- .../theme-json-reference/theme-json-living.md | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 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 cf7624766c9ff..f0ccf307aed59 100644 --- a/docs/reference-guides/theme-json-reference/theme-json-living.md +++ b/docs/reference-guides/theme-json-reference/theme-json-living.md @@ -145,14 +145,14 @@ Border styles. | Property | Type | Props | | --- | --- |--- | -| color | string | | -| radius | undefined | | -| style | string | | -| width | string | | -| top | object | color, style, width | -| right | object | color, style, width | -| bottom | object | color, style, width | -| left | object | color, style, width | +| color | string, object | | +| radius | string, object | | +| style | string, object | | +| width | string, object | | +| top | string, object | color, style, width | +| right | string, object | color, style, width | +| bottom | string, object | color, style, width | +| left | string, object | color, style, width | --- @@ -162,9 +162,9 @@ Color styles. | Property | Type | Props | | --- | --- |--- | -| background | string | | -| gradient | string | | -| text | string | | +| background | string, object | | +| gradient | string, object | | +| text | string, object | | --- @@ -174,7 +174,7 @@ Spacing styles. | Property | Type | Props | | --- | --- |--- | -| blockGap | string | | +| blockGap | string, object | | | margin | object | bottom, left, right, top | | padding | object | bottom, left, right, top | @@ -186,14 +186,14 @@ Typography styles. | Property | Type | Props | | --- | --- |--- | -| fontFamily | string | | -| fontSize | string | | -| fontStyle | string | | -| fontWeight | string | | -| letterSpacing | string | | -| lineHeight | string | | -| textDecoration | string | | -| textTransform | string | | +| fontFamily | string, object | | +| fontSize | string, object | | +| fontStyle | string, object | | +| fontWeight | string, object | | +| letterSpacing | string, object | | +| lineHeight | string, object | | +| textDecoration | string, object | | +| textTransform | string, object | | --- @@ -203,7 +203,7 @@ CSS and SVG filter styles. | Property | Type | Props | | --- | --- |--- | -| duotone | string | | +| duotone | string, object | | --- @@ -220,10 +220,10 @@ Outline styles. | Property | Type | Props | | --- | --- |--- | -| color | string | | -| offset | string | | -| style | string | | -| width | string | | +| color | string, object | | +| offset | string, object | | +| style | string, object | | +| width | string, object | | --- From 73236fbd4b0d60f7d8608b05a08418d8cc7123a3 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Wed, 30 Nov 2022 12:00:53 +0000 Subject: [PATCH 09/11] Result of docs:build script --- .../theme-json-reference/theme-json-living.md | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 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 f0ccf307aed59..8f07f409028be 100644 --- a/docs/reference-guides/theme-json-reference/theme-json-living.md +++ b/docs/reference-guides/theme-json-reference/theme-json-living.md @@ -145,14 +145,14 @@ Border styles. | Property | Type | Props | | --- | --- |--- | -| color | string, object | | -| radius | string, object | | -| style | string, object | | -| width | string, object | | -| top | string, object | color, style, width | -| right | string, object | color, style, width | -| bottom | string, object | color, style, width | -| left | string, object | color, style, width | +| color | undefined | | +| radius | undefined | | +| style | undefined | | +| width | undefined | | +| top | object | color, style, width | +| right | object | color, style, width | +| bottom | object | color, style, width | +| left | object | color, style, width | --- @@ -162,9 +162,9 @@ Color styles. | Property | Type | Props | | --- | --- |--- | -| background | string, object | | -| gradient | string, object | | -| text | string, object | | +| background | undefined | | +| gradient | undefined | | +| text | undefined | | --- @@ -174,7 +174,7 @@ Spacing styles. | Property | Type | Props | | --- | --- |--- | -| blockGap | string, object | | +| blockGap | undefined | | | margin | object | bottom, left, right, top | | padding | object | bottom, left, right, top | @@ -186,14 +186,14 @@ Typography styles. | Property | Type | Props | | --- | --- |--- | -| fontFamily | string, object | | -| fontSize | string, object | | -| fontStyle | string, object | | -| fontWeight | string, object | | -| letterSpacing | string, object | | -| lineHeight | string, object | | -| textDecoration | string, object | | -| textTransform | string, object | | +| fontFamily | undefined | | +| fontSize | undefined | | +| fontStyle | undefined | | +| fontWeight | undefined | | +| letterSpacing | undefined | | +| lineHeight | undefined | | +| textDecoration | undefined | | +| textTransform | undefined | | --- @@ -203,7 +203,7 @@ CSS and SVG filter styles. | Property | Type | Props | | --- | --- |--- | -| duotone | string, object | | +| duotone | undefined | | --- @@ -220,10 +220,10 @@ Outline styles. | Property | Type | Props | | --- | --- |--- | -| color | string, object | | -| offset | string, object | | -| style | string, object | | -| width | string, object | | +| color | undefined | | +| offset | undefined | | +| style | undefined | | +| width | undefined | | --- From 679ecbc16689b23e65f09b9d8f8e894cfede8d42 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Tue, 20 Dec 2022 12:05:42 +0000 Subject: [PATCH 10/11] Run docs:build to update docs --- .../theme-json-reference/theme-json-living.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 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 496ff5b618cc4..7aa790dd97789 100644 --- a/docs/reference-guides/theme-json-reference/theme-json-living.md +++ b/docs/reference-guides/theme-json-reference/theme-json-living.md @@ -145,10 +145,10 @@ Border styles. | Property | Type | Props | | --- | --- |--- | -| color | string | | +| color | string, object | | | radius | string, object | | -| style | string | | -| width | string | | +| style | string, object | | +| width | string, object | | | top | object | color, style, width | | right | object | color, style, width | | bottom | object | color, style, width | @@ -162,9 +162,9 @@ Color styles. | Property | Type | Props | | --- | --- |--- | -| background | string | | -| gradient | string | | -| text | string | | +| background | string, object | | +| gradient | string, object | | +| text | string, object | | --- @@ -174,7 +174,7 @@ Spacing styles. | Property | Type | Props | | --- | --- |--- | -| blockGap | string | | +| blockGap | string, object | | | margin | object | bottom, left, right, top | | padding | object | bottom, left, right, top | @@ -186,14 +186,14 @@ Typography styles. | Property | Type | Props | | --- | --- |--- | -| fontFamily | string | | -| fontSize | string | | -| fontStyle | string | | -| fontWeight | string | | -| letterSpacing | string | | -| lineHeight | string | | -| textDecoration | string | | -| textTransform | string | | +| fontFamily | string, object | | +| fontSize | string, object | | +| fontStyle | string, object | | +| fontWeight | string, object | | +| letterSpacing | string, object | | +| lineHeight | string, object | | +| textDecoration | string, object | | +| textTransform | string, object | | --- @@ -203,7 +203,7 @@ CSS and SVG filter styles. | Property | Type | Props | | --- | --- |--- | -| duotone | string | | +| duotone | string, object | | --- @@ -220,10 +220,10 @@ Outline styles. | Property | Type | Props | | --- | --- |--- | -| color | string | | -| offset | string | | -| style | string | | -| width | string | | +| color | string, object | | +| offset | string, object | | +| style | string, object | | +| width | string, object | | --- From ea9eb1c29f739e1aab2fcee546846b24da3feb24 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Tue, 20 Dec 2022 12:49:18 +0000 Subject: [PATCH 11/11] Make ref logic more specific --- bin/api-docs/gen-theme-reference.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/api-docs/gen-theme-reference.js b/bin/api-docs/gen-theme-reference.js index b74deb9fb9d27..45edecf6bd1a2 100644 --- a/bin/api-docs/gen-theme-reference.js +++ b/bin/api-docs/gen-theme-reference.js @@ -176,8 +176,9 @@ const formatType = ( prop ) => { propTypes.forEach( ( item ) => { if ( item.type ) types.push( item.type ); - // $ref is always an object - if ( item.$ref ) types.push( 'object' ); + // refComplete is always an object + if ( item.$ref && item.$ref === '#/definitions/refComplete' ) + types.push( 'object' ); } ); type = [ ...new Set( types ) ].join( ', ' );