-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Register webfonts defined in styles variations #39886
Conversation
It took me some time to be able to test this :). Should we include a variation with a font file in the "emptytheme" embedded in the Gutenberg plugin to make testing this easier in the future? Regardless, I'm noticing two bugs: I have a default theme.json without font family (default) and one variation with a font applied to the whole body.
(Testing in safari) |
This I'm also testing alongside the Twenty Twenty-Two style variations here: WordPress/wordpress-develop#2440 The former works just fine aside from the issues that @youknowriad noted above — I am able to reproduce those. But the Twenty Twenty-Two PR doesn't seem to load any fonts at all. 🤔 If someone could help gut check that for me, I'd appreciate it — I'm unclear if the problem is over on the Twenty Twenty-Two end or in this PR. |
Apparently I didn't test after rebasing the PR, and some things have changed 😅
After some debugging, I don't think this is a bug in this PR... "styles": {
"typography": {
"fontFamily": "sans-serif"
}
} If we want to change that behavior, it will need to be done in a separate PR since it's more generic and not related to the webfonts... it's an overrides/resets issue when a variation has something defined that doesn't exist in the main file. |
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 looking good to me. (I agree the reset bug is separate, I'll look into it).
Also cc @oandregal in case you want to take a look here.
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.
I tested with @kjellr's TT2 variations PR and it works for me
What?
Fixes #39702
Registers webfonts defined in variations, as described in the issue.
Why?
This will allow defining webfonts in styles variations.
How?
Testing Instructions
Testing instructions available in #39702