Skip to content

Commit

Permalink
Webfonts API: Document fontFace and it’s values in theme.json sch…
Browse files Browse the repository at this point in the history
…ema (#41844)

* 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
  • Loading branch information
grappler committed Jun 27, 2022
1 parent fa24765 commit afe7165
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 1 deletion.
Expand Up @@ -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 |

---

Expand Down
96 changes: 96 additions & 0 deletions schemas/json/theme.json
Expand Up @@ -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
Expand Down

0 comments on commit afe7165

Please sign in to comment.