From acbc5337e1d3b19b36811ca77bb52c197787ba1a Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Tue, 21 Jun 2022 17:38:01 +0200 Subject: [PATCH 1/8] =?UTF-8?q?Document=20fontFace=20and=20it=E2=80=99s=20?= =?UTF-8?q?values=20in=20theme.json=20schema?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- schemas/json/theme.json | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/schemas/json/theme.json b/schemas/json/theme.json index 75e346e0982f5b..0040cd119ad686 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -317,6 +317,33 @@ "fontFamily": { "description": "CSS font-family value.", "type": "string" + }, + "fontFace": { + "description": "", + "type": "array", + "items": { + "type": "object", + "fontFamily": { + "description": "CSS font-family value.", + "type": "string" + }, + "fontWeight": { + "description": "CSS font-weight values, list delimited by spaces.", + "type": "string" + }, + "fontStyle": { + "description": "CSS font-style value.", + "type": "string" + }, + "fontStretch": { + "description": "CSS font-stretch value.", + "type": "string" + }, + "src": { + "description": "Paths or URLs to the font files.", + "type": "array" + } + } } }, "additionalProperties": false From e44812c582e200e3879100f2602b7017416e5e8b Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Wed, 22 Jun 2022 01:32:15 +0200 Subject: [PATCH 2/8] npm run docs:build --- docs/reference-guides/theme-json-reference/theme-json-living.md | 2 +- schemas/json/theme.json | 2 +- 2 files changed, 2 insertions(+), 2 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 6d0c02e8d27ed3..ac229ecc3c6cf4 100644 --- a/docs/reference-guides/theme-json-reference/theme-json-living.md +++ b/docs/reference-guides/theme-json-reference/theme-json-living.md @@ -101,7 +101,7 @@ Settings related to typography. | textTransform | boolean | true | | | dropCap | boolean | true | | | fontSizes | array | | name, size, slug | -| fontFamilies | array | | fontFamily, name, slug | +| fontFamilies | array | | fontFace, fontFamily, name, slug | --- diff --git a/schemas/json/theme.json b/schemas/json/theme.json index 0040cd119ad686..e81221b11353b4 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -328,7 +328,7 @@ "type": "string" }, "fontWeight": { - "description": "CSS font-weight values, list delimited by spaces.", + "description": "List of available font weights, separated by a space.", "type": "string" }, "fontStyle": { From f1bd35e0c7b0ca6850a2c22d8604cf919de9fd7e Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Wed, 22 Jun 2022 09:58:33 +0200 Subject: [PATCH 3/8] Fully document all options --- schemas/json/theme.json | 80 +++++++++++++++++++++++++++++++++++------ 1 file changed, 70 insertions(+), 10 deletions(-) diff --git a/schemas/json/theme.json b/schemas/json/theme.json index e81221b11353b4..d788fd161cb263 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -316,7 +316,8 @@ }, "fontFamily": { "description": "CSS font-family value.", - "type": "string" + "type": "string", + "default": "" }, "fontFace": { "description": "", @@ -325,25 +326,84 @@ "type": "object", "fontFamily": { "description": "CSS font-family value.", - "type": "string" + "type": "string", + "default": "" + }, + "fontStyle": { + "description": "CSS font-style value.", + "type": "string", + "default": "normal" }, "fontWeight": { "description": "List of available font weights, separated by a space.", - "type": "string" + "type": "string", + "default": "400" }, - "fontStyle": { - "description": "CSS font-style value.", - "type": "string" + "fontDisplay": { + "description": "CSS font-display value.", + "type": "string", + "default": "fallback", + "enum": [ + "auto", + "block", + "fallback", + "swap" + ] + }, + "src": { + "description": "Paths or URLs to the font files.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ], + "default": [] }, "fontStretch": { "description": "CSS font-stretch value.", "type": "string" }, - "src": { - "description": "Paths or URLs to the font files.", - "type": "array" + "ascendOverride": { + "description": "CSS ascend-override value.", + "type": "string" + }, + "descendOverride": { + "description": "CSS descend-override value.", + "type": "string" + }, + "fontVariant": { + "description": "CSS font-variant value.", + "type": "string" + }, + "fontFeatureSettings": { + "description": "CSS font-feature-settings value.", + "type": "string" + }, + "fontVariationSettings": { + "description": "CSS font-variation-settings value.", + "type": "string" + }, + "lineGapOverride": { + "description": "CSS line-gap-override value.", + "type": "string" + }, + "sizeAdjust": { + "description": "CSS size-adjust value.", + "type": "string" + }, + "unicodeRange": { + "description": "CSS unicode-range value.", + "type": "string" } - } + }, + "required": [ "fontFamily", "fontWeight", "src" ], + "additionalProperties": false } }, "additionalProperties": false From 8eab5992bb3351a404d77566cc2ea4a8bc382894 Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Wed, 22 Jun 2022 10:02:54 +0200 Subject: [PATCH 4/8] required & additionalProperties placed incorrectly --- 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 d788fd161cb263..0e6a50871f2308 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -400,10 +400,10 @@ "unicodeRange": { "description": "CSS unicode-range value.", "type": "string" - } - }, - "required": [ "fontFamily", "fontWeight", "src" ], - "additionalProperties": false + }, + "required": [ "fontFamily", "fontWeight", "src" ], + "additionalProperties": false + } } }, "additionalProperties": false From 8e57ca5db7693fe3f1a2a658ce3d370470d5beee Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Wed, 22 Jun 2022 10:13:23 +0200 Subject: [PATCH 5/8] Missing properties and small fixes --- schemas/json/theme.json | 157 ++++++++++++++++++++-------------------- 1 file changed, 79 insertions(+), 78 deletions(-) diff --git a/schemas/json/theme.json b/schemas/json/theme.json index 0e6a50871f2308..88e2a74b07093e 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -316,92 +316,93 @@ }, "fontFamily": { "description": "CSS font-family value.", - "type": "string", - "default": "" + "type": "string" }, "fontFace": { - "description": "", + "description": "Array of font-face declarations.", "type": "array", "items": { "type": "object", - "fontFamily": { - "description": "CSS font-family value.", - "type": "string", - "default": "" - }, - "fontStyle": { - "description": "CSS font-style value.", - "type": "string", - "default": "normal" - }, - "fontWeight": { - "description": "List of available font weights, separated by a space.", - "type": "string", - "default": "400" - }, - "fontDisplay": { - "description": "CSS font-display value.", - "type": "string", - "default": "fallback", - "enum": [ - "auto", - "block", - "fallback", - "swap" - ] - }, - "src": { - "description": "Paths or URLs to the font files.", - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { + "properties": { + "fontFamily": { + "description": "CSS font-family value.", + "type": "string", + "default": "" + }, + "fontStyle": { + "description": "CSS font-style value.", + "type": "string", + "default": "normal" + }, + "fontWeight": { + "description": "List of available font weights, separated by a space.", + "type": "string", + "default": "400" + }, + "fontDisplay": { + "description": "CSS font-display value.", + "type": "string", + "default": "fallback", + "enum": [ + "auto", + "block", + "fallback", + "swap" + ] + }, + "src": { + "description": "Paths or URLs to the font files.", + "oneOf": [ + { "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } } - } - ], - "default": [] - }, - "fontStretch": { - "description": "CSS font-stretch value.", - "type": "string" - }, - "ascendOverride": { - "description": "CSS ascend-override value.", - "type": "string" - }, - "descendOverride": { - "description": "CSS descend-override value.", - "type": "string" - }, - "fontVariant": { - "description": "CSS font-variant value.", - "type": "string" - }, - "fontFeatureSettings": { - "description": "CSS font-feature-settings value.", - "type": "string" - }, - "fontVariationSettings": { - "description": "CSS font-variation-settings value.", - "type": "string" - }, - "lineGapOverride": { - "description": "CSS line-gap-override value.", - "type": "string" - }, - "sizeAdjust": { - "description": "CSS size-adjust value.", - "type": "string" - }, - "unicodeRange": { - "description": "CSS unicode-range value.", - "type": "string" + ], + "default": [] + }, + "fontStretch": { + "description": "CSS font-stretch value.", + "type": "string" + }, + "ascendOverride": { + "description": "CSS ascend-override value.", + "type": "string" + }, + "descendOverride": { + "description": "CSS descend-override value.", + "type": "string" + }, + "fontVariant": { + "description": "CSS font-variant value.", + "type": "string" + }, + "fontFeatureSettings": { + "description": "CSS font-feature-settings value.", + "type": "string" + }, + "fontVariationSettings": { + "description": "CSS font-variation-settings value.", + "type": "string" + }, + "lineGapOverride": { + "description": "CSS line-gap-override value.", + "type": "string" + }, + "sizeAdjust": { + "description": "CSS size-adjust value.", + "type": "string" + }, + "unicodeRange": { + "description": "CSS unicode-range value.", + "type": "string" + } }, - "required": [ "fontFamily", "fontWeight", "src" ], + "required": [ "fontFamily", "fontWeight", "src" ], "additionalProperties": false } } From d16896dbfdebc597ed4766365bcd30802620d75a Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Wed, 22 Jun 2022 10:33:19 +0200 Subject: [PATCH 6/8] Remove extra space --- schemas/json/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/json/theme.json b/schemas/json/theme.json index 88e2a74b07093e..af45896b6387e7 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -402,7 +402,7 @@ "type": "string" } }, - "required": [ "fontFamily", "fontWeight", "src" ], + "required": [ "fontFamily", "fontWeight", "src" ], "additionalProperties": false } } From c62934110a47ee204b494191c1220e2a34137cd1 Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Wed, 22 Jun 2022 10:35:56 +0200 Subject: [PATCH 7/8] Font-weight is not required --- schemas/json/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/json/theme.json b/schemas/json/theme.json index af45896b6387e7..24fe2429c8f5d2 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -402,7 +402,7 @@ "type": "string" } }, - "required": [ "fontFamily", "fontWeight", "src" ], + "required": [ "fontFamily", "src" ], "additionalProperties": false } } From 76270489e60eaf573f0ea8189cf0480f0752e27a Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Wed, 22 Jun 2022 10:57:17 +0200 Subject: [PATCH 8/8] Font weight can be either a string or an integer --- schemas/json/theme.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/schemas/json/theme.json b/schemas/json/theme.json index 24fe2429c8f5d2..bb9de11330d40a 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -337,7 +337,15 @@ "fontWeight": { "description": "List of available font weights, separated by a space.", "type": "string", - "default": "400" + "default": "400", + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] }, "fontDisplay": { "description": "CSS font-display value.",