[wp-trac] [WordPress Trac] #59911: WordPress 6.4 changes the font-face generation using wrong fontFamily attribute from theme.json preset

WordPress Trac noreply at wordpress.org
Thu Nov 30 22:19:41 UTC 2023


#59911: WordPress 6.4 changes the font-face generation using wrong fontFamily
attribute from theme.json preset
-------------------------------+------------------------------
 Reporter:  alexandrebuffet    |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Themes             |     Version:  6.4
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by ironprogrammer):

 * keywords:   => reporter-feedback


Comment:

 Welcome back to Trac, @alexandrebuffet, and thanks for the report!

 6.4 shipped an update where the `@font-face { font-family:...` value is
 derived (see [https://github.com/WordPress/gutenberg/pull/54615 GB PR
 54615]). Now the `font-family` is set to the first font found in the
 `typography.fontFamilies.fontFamily` prop.

 This change addressed the intended behavior when
 [https://developer.wordpress.org/themes/global-settings-and-
 styles/settings/typography/#custom-font-families registering font
 families] -- from the docs:

 > **fontFamily**: ''(Required)'' A valid value that will map to the CSS
 `font-family` value. Generally, this will be a font stack (a list of
 families that the browser will try to use in order).

 Hence, the resulting `font-family:var(--font-primary)` you're seeing.

 > IMO I think that the value of the preset and its "fontFamily" attribute
 should be able to be different from the "fontFamily" value to be used in
 the font-face, as was the case before 6.4.

 Do you have an example where/how this would be used, i.e. having a font
 variation that doesn't belong to the same family?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59911#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list