-
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
Font Face: avoid using non required property as index and use right property to render font face #54610
Conversation
Warning: Type of PR label error To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. |
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/compat/wordpress-6.4/fonts/font-face/class-wp-font-face-resolver.php |
Flaky tests detected in 558b2ad. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6237676250
|
// Skip if font-family "name" is not defined. | ||
if ( empty( $definition['name'] ) ) { | ||
// Skip if font-family "slug" is not defined. | ||
if ( empty( $definition['slug'] ) ) { |
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 don't think it should use slug
. Instead I think it should use fontFamily
. Why? slug
is not the proper name of the Font Family, but rather is the lowercase and hyphen version of the name. Currently Font Face uses this font-family name in the CSS.
I have PR coming shortly to show it in action.
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.
PR #54615 uses the fontFamily
setting as the fallback to get the name.
Sorry for the overlap. Closing in favor of #54610. |
What?
Why?
Breaking with fonts families definitions, not including a name property.
How?
Testing Instructions
name
property set.Todo:
Fix the tests accordingly to these changes.