Repository navigation
Google Fonts: Fix font detection when fallback families are present - #52586
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 1 file.
|
|
Tested on JN site + Beta. Confirmed that @font-face is appearing on 2023 theme with styles: set in theme.json |
e2090fa to
ddec51a
Compare
Proposed changes
The google fonts module can leave out a font when its value includes fallbacks. For example:
var(--wp--preset--font-family--inter)- Found correctlyvar(--wp--preset--font-family--inter), sans-serif- Left out because it doesn't end in).Fix the regex and add tests. I had Astra do this.
Related product discussion/links
Partially fixes #50180
Does this pull request change what data or activity we track or use?
No
Testing instructions
theme.json.styles.typography.fontFamilyto reference that font with a fallback, such asvar(--wp--preset--font-family--inter), system-ui, sans-serif.@font-facerule for the selected font.google-font-facePHP test suite.