Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webfonts API: Document fontFace and it’s values in theme.json schema #41844

Merged
merged 8 commits into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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