#57529 closed enhancement (fixed)
Adds fluid typography minimum font size settings to wp_get_typography_font_size_value()
| Reported by: | andrewserong | Owned by: | hellofromTonya |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.2 |
| Component: | Editor | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests gutenberg-merge commit |
| Cc: | Focuses: |
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.
4 years ago
#1
- Keywords has-patch has-unit-tests added
#2
@
4 years ago
- Component General → Editor
- Keywords gutenberg-merge added
- Milestone Awaiting Review → 6.2
- Version trunk
@hellofromTonya commented on PR #3866:
4 years 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:
4 years 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:
4 years 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
@
4 years ago
- Keywords commit added
- Owner set to
- Status new → 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:
4 years ago
#8
Committed via https://core.trac.wordpress.org/changeset/55133.
#9
@
4 years ago
- Summary Backport fluid typography minimum font size settings from Gutenberg → Adds fluid typography minimum font size settings to wp_get_typography_font_size_value()
@andrewserong commented on PR #3866:
4 years ago
#10
Wonderful, thank you for landing this one, Tonya! 🙇
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This PR backports the PHP changes in this Gutenberg PR: https://github.com/WordPress/gutenberg/pull/42489
The feature adds a
settings.typography.fluid.minFontSizeproperty totheme.jsonwhich allows themes to set a minimum font size for fluid typography calculations.### Testing instructions
To test: edit the TT3 theme's
theme.jsonfile to swap outsettings.typography.fluidfrom its current boolean value tor an object that specifies a minimum font size. For example, the following sets the minimum font size to 15px:"fluid": { "minFontSize": "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, and20pxrespectively. 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