Skip to content

Commit

Permalink
Font Library: add font family and font face preview keys to schema (#…
Browse files Browse the repository at this point in the history
…56793)

* Add preview key  to theme.json schema

* add preview key to php data sanitization schema

* update description text

Co-authored-by: Jeff Ong <jonger4@gmail.com>

* update docs

---------

Co-authored-by: Jeff Ong <jonger4@gmail.com>
  • Loading branch information
matiasbenedetto and jffng committed Dec 5, 2023
1 parent 0e98444 commit 62ecf4a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Settings related to typography.
| textTransform | boolean | true | |
| dropCap | boolean | true | |
| fontSizes | array | | fluid, name, size, slug |
| fontFamilies | array | | fontFace, fontFamily, name, slug |
| fontFamilies | array | | fontFace, fontFamily, name, preview, slug |

---

Expand Down
2 changes: 2 additions & 0 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ class WP_Theme_JSON_Gutenberg {
'fontFamily' => null,
'name' => null,
'slug' => null,
'preview' => null,
'fontFace' => array(
array(
'ascentOverride' => null,
Expand All @@ -446,6 +447,7 @@ class WP_Theme_JSON_Gutenberg {
'sizeAdjust' => null,
'src' => null,
'unicodeRange' => null,
'preview' => null,
),
),
),
Expand Down
8 changes: 8 additions & 0 deletions schemas/json/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,10 @@
"description": "CSS font-family value.",
"type": "string"
},
"preview": {
"description": "URL to a preview image of the font family.",
"type": "string"
},
"fontFace": {
"description": "Array of font-face declarations.",
"type": "array",
Expand Down Expand Up @@ -713,6 +717,10 @@
"unicodeRange": {
"description": "CSS unicode-range value.",
"type": "string"
},
"preview": {
"description": "URL to a preview image of the font face.",
"type": "string"
}
},
"required": [ "fontFamily", "src" ],
Expand Down

1 comment on commit 62ecf4a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 62ecf4a.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7107254289
📝 Reported issues:

Please sign in to comment.