From afe71659963a89c37d0a7c4095cf8f5881561c5f Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Mon, 27 Jun 2022 10:26:46 +0200 Subject: [PATCH] =?UTF-8?q?Webfonts=20API:=20Document=20`fontFace`=20and?= =?UTF-8?q?=20it=E2=80=99s=20values=20in=20`theme.json`=20schema=20(#41844?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Document fontFace and it’s values in theme.json schema * npm run docs:build * Fully document all options * required & additionalProperties placed incorrectly * Missing properties and small fixes * Remove extra space * Font-weight is not required * Font weight can be either a string or an integer --- .../theme-json-reference/theme-json-living.md | 2 +- schemas/json/theme.json | 96 +++++++++++++++++++ 2 files changed, 97 insertions(+), 1 deletion(-) 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 6d0c02e8d27ed..ac229ecc3c6cf 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 f4c9a4082a93c..9dd0c096bb6fa 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -317,6 +317,102 @@ "fontFamily": { "description": "CSS font-family value.", "type": "string" + }, + "fontFace": { + "description": "Array of font-face declarations.", + "type": "array", + "items": { + "type": "object", + "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", + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "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" + } + }, + "required": [ "fontFamily", "src" ], + "additionalProperties": false + } } }, "additionalProperties": false