#57529 closed enhancement (fixed)
Adds fluid typography minimum font size settings to wp_get_typography_font_size_value()
Reported by: | andrewserong | Owned by: | hellofromTonya |
---|---|---|---|
Milestone: | 6.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Editor | Keywords: | has-patch has-unit-tests gutenberg-merge commit |
Focuses: | Cc: |
Description
In https://github.com/WordPress/gutenberg/pull/42489 a feature was added to fluid typography in theme.json that allows a theme to specify a minimum font size to be used in fluid typography calculated font-size rules. The provided value ensures the fluid typography rules do not go below the settings.typography.fluid.minFontSize
value. For example, if this is set to 16px
then any font-sizes used at 16px
or less will be output as-is without fluid typography rules being applied.
This feature is expected to land as part of WordPress 6.2, so it would be good to ensure that the PHP changes are backported in time for the release.
Change History (10)
This ticket was mentioned in PR #3866 on WordPress/wordpress-develop by @andrewserong.
20 months ago
#1
- Keywords has-patch has-unit-tests added
#2
@
20 months ago
- Component changed from General to Editor
- Keywords gutenberg-merge added
- Milestone changed from Awaiting Review to 6.2
- Version trunk deleted
@hellofromTonya commented on PR #3866:
20 months ago
#3
CI failures due to a missing closing )
on https://github.com/WordPress/wordpress-develop/pull/3866/commits/d56e8a88650348a1b477d299eedb4a78c85b24c7 🤦♀️
@hellofromTonya commented on PR #3866:
20 months ago
#4
Confirmed the PR does backport the PHP changes from Gutenberg's /lib/block-supports/typography.php
from Gutenberg's PR 42489 ✅
Note: The JavaScript changes will be handled when the packages are updated.
@hellofromTonya commented on PR #3866:
20 months ago
#5
Confirmed the PR does backport the PHP changes from Gutenberg's /lib/block-supports/typography.php
from Gutenberg's PR 42489 ✅
Note: The JavaScript changes will be handled when the packages are updated.
#6
@
20 months ago
- Keywords commit added
- Owner set to hellofromTonya
- Status changed from new to reviewing
As noted in the PR's approval, the PR does include all of the relevant PHP additions/changes from Gutenberg PR 42489. It includes integration tests.
Marking for commit
. Self-assigning for the commit.
@hellofromTonya commented on PR #3866:
20 months ago
#8
Committed via https://core.trac.wordpress.org/changeset/55133.
#9
@
20 months ago
- Summary changed from Backport fluid typography minimum font size settings from Gutenberg to Adds fluid typography minimum font size settings to wp_get_typography_font_size_value()
@andrewserong commented on PR #3866:
20 months ago
#10
Wonderful, thank you for landing this one, Tonya! 🙇
This PR backports the PHP changes in this Gutenberg PR: https://github.com/WordPress/gutenberg/pull/42489
The feature adds a
settings.typography.fluid.minFontSize
property totheme.json
which allows themes to set a minimum font size for fluid typography calculations.### Testing instructions
To test: edit the TT3 theme's
theme.json
file to swap outsettings.typography.fluid
from its current boolean value tor an object that specifies a minimum font size. For example, the following sets the minimum font size to 15px:Then, in a post, create a few paragraphs and set a variety of custom font sizes. In the below screenshot of the markup, there are three paragraph blocks, set to
15px
,16px
, and20px
respectively. Notice how the first block does not have fluid rules applied, and for the second and third blocks, the minimum size is15px
:Note: this PR backports the PHP changes only. The update to support this feature within the block editor will be backported as part of the usual JS packages update. It should be pretty safe to land this PHP change first.
Trac ticket: https://core.trac.wordpress.org/ticket/57529