-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Webfonts API: Document fontFace and it’s values in theme.json schema
#41844
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
Conversation
theme.json schematheme.json schema
theme.json schemafontFace and it’s values in theme.json schema
fabiankaegy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great addition :) Added one comment. But that can also happen in a follow up 👍
|
It would be great if this could be backported to wp/6.0 too. Happy to create a second PR for that. |
|
@adamziel, I think this needs to be backported so that the schema URL is correctly resolved. It's not a blocker for a minor release. |
…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
|
I just cherry-picked this PR to the wp/6.0 branch to get it included in the next release: 6a79add |
What?
Document the
fontFaceproperties that we introduced in WordPress 6.0 as part of the WebFonts API.Why?
Because there is no documentation.
How?
By including the basic technical documentation to the
theme.jsonschema.Testing Instructions
Create a
theme.jsonand paste the following in the code. Currently, it says that thefontFaceis not allowed. Replacehttps://schemas.wp.org/trunk/theme.jsonwithhttps://raw.githubusercontent.com/grappler/gutenberg/schema-fontFace/schemas/json/theme.jsonto test changes.`theme.json` code
{ "$schema": "https://schemas.wp.org/trunk/theme.json", "version": 2, "settings": { "typography": { "fontFamilies": [ { "fontFamily": "\"Source Serif Pro\", serif", "name": "Source Serif Pro", "slug": "source-serif-pro" }, { "fontFamily": "\"Inter\", sans-serif", "name": "Inter", "slug": "inter", "fontFace": [ { "fontFamily": "Inter", "fontWeight": "200 900", "fontStyle": "normal", "fontStretch": "normal", "src": [ "file:./assets/fonts/inter/Inter.ttf" ] } ] } ] } } }Screenshots