Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport Fluid Typography settings for minimum font size #3866

Conversation

andrewserong
Copy link

@andrewserong andrewserong commented Jan 19, 2023

This PR backports the PHP changes in this Gutenberg PR: WordPress/gutenberg#42489

The feature adds a settings.typography.fluid.minFontSize property to theme.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 out settings.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:

			"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, and 20px respectively. Notice how the first block does not have fluid rules applied, and for the second and third blocks, the minimum size is 15px:

image

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


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@hellofromtonya
Copy link
Contributor

CI failures due to a missing closing ) on d56e8a8 🤦‍♀️

Copy link
Contributor

@hellofromtonya hellofromtonya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Confirmed the PR does backport the PHP changes from Gutenberg's /lib/block-supports/typography.php from Gutenberg's PR 42489

I agree that it is safe to land these PHP changes ahead of the package updates. Once the packages are updated, then minimum font size feature can fully tested.

Approving for commit.

@hellofromtonya hellofromtonya force-pushed the try/backport-fluid-typography-settings-for-minimum-font-size branch from 53fcdfc to 74588c3 Compare January 24, 2023 20:13
@hellofromtonya
Copy link
Contributor

@andrewserong
Copy link
Author

Wonderful, thank you for landing this one, Tonya! 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants