#61118 closed defect (bug) (fixed)
Fluid typography: pass theme.json settings to override merged theme data
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.6 | Priority: | normal |
Severity: | normal | Version: | 6.5 |
Component: | Editor | Keywords: | has-patch has-unit-tests gutenberg-merge needs-dev-note |
Focuses: | Cc: |
Description
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 atheme_json
settings array. The argument as priority over the return value ofwp_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
Change History (14)
This ticket was mentioned in PR #6477 on WordPress/wordpress-develop by @ramonopoly.
10 months ago
#1
#2
@
10 months ago
- Keywords needs-dev-note added
- Owner set to audrasjb
- Status changed from new to reviewing
- Version changed from trunk to 6.5
Adding needs-dev-note
to mention it at least in the Misc Editor changes since this changeset replaces a bool
argument with a bool|array
argument of a different nature.
I also added some feedback in the PR.
@isabel_brison commented on PR #6477:
9 months ago
#4
Committed in r58171.
This ticket was mentioned in PR #6578 on WordPress/wordpress-develop by @ramonopoly.
9 months ago
#5
https://github.com/WordPress/wordpress-develop/pull/6477 was committed but needed a rebase, as there were subsequent commits that changed the CSS root selector.
This commit updates failing tests caused after merge
Updates the second argument of wp_get_typography_font_size_value() to be a theme_json settings array.
Add a backwards compatibility condition to handle booleans.
Syncs:
The changes:
#### 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