[wp-trac] [WordPress Trac] #61118: Fluid typography: pass theme.json settings to override merged theme data

WordPress Trac noreply at wordpress.org
Thu May 2 02:07:09 UTC 2024


#61118: Fluid typography: pass theme.json settings to override merged theme data
-------------------------+-------------------------------------------------
 Reporter:  ramonopoly   |      Owner:  (none)
     Type:  defect       |     Status:  new
  (bug)                  |
 Priority:  normal       |  Milestone:  6.6
Component:  Editor       |    Version:  trunk
 Severity:  normal       |   Keywords:  has-patch has-unit-tests gutenberg-
  Focuses:               |  merge
-------------------------+-------------------------------------------------
 A ticket to track the syncing of Gutenberg PR
 https://github.com/WordPress/gutenberg/pull/58362

 The changes:

 - Update the second argument of `wp_get_typography_font_size_value()` to
 be a `theme_json` settings array. The argument as priority over the return
 value of `wp_get_global_settings()`
 - Add a backwards compatibility condition to handle booleans.

 Why?

 To generate a stylesheet, theme.json settings are often passed directly to
 WP_Theme_JSON.

 Because typography block supports looks at the global settings only, the
 font sizes and CSS vars will have a `clamp()` value in the returned
 stylesheet if the **current theme** has fluid typography activated.

 Passing theme.json settings to gutenberg_get_typography_font_size_value()
 as the second argument allows users of the class interface to provide
 their own settings, which will override any global theme settings.

 See Gutenberg bug report:
 https://github.com/WordPress/gutenberg/issues/58135

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61118>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list