Backport: Fluid typography - adjust font size min and max rules (#45536)#3602
Closed
ramonjd wants to merge 2 commits intoWordPress:trunkfrom
Closed
Backport: Fluid typography - adjust font size min and max rules (#45536)#3602ramonjd wants to merge 2 commits intoWordPress:trunkfrom
ramonjd wants to merge 2 commits intoWordPress:trunkfrom
Conversation
This was referenced Nov 10, 2022
Member
Author
|
Failing PHPUnit 7.1 tests look unrelated |
- Where no fluid max values are set (e.g., single or custom font size values), the "size" value will act as the maximum value in a clamp() function. - Do not clamp value if a font size is lower than 14px - Always honor a supplied fluid.min value, the lower bound of 14px notwidthstanding
8411dff to
f59408e
Compare
|
@hellofromtonya might you be able to help with this? |
desrosj
reviewed
Nov 11, 2022
| * formula depending on available, valid values. | ||
| * | ||
| * @since 6.1.0 | ||
| * @since 6.1.1 Adjusted min a |
Member
There was a problem hiding this comment.
Looks like this is an incomplete update. @ramonjd could you adjust this?
Member
Author
There was a problem hiding this comment.
Sorry, just saw this. Thanks @desrosj
I see this PR has been merged. Should I open a new one to update the comment?
Member
Author
There was a problem hiding this comment.
Oh I see you updated it: https://github.com/ramonjd/wordpress-develop/blob/trunk/src/wp-includes/block-supports/typography.php#L455
Thank you very much!
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backporting changes in WordPress/gutenberg#45536
Trac ticket: https://core.trac.wordpress.org/ticket/57075
Updates to the fluid typography rules:
>16px. This applies to custom values from the editor or single-value theme.json styles. Font sizes below this will not be clamped.fluid.minvalue has been specified, the lower bound rule of>16pxwon't be enforced on this value. Presets with a fluid object therefore, give precedence to theme author's values.fluid.maxbut there isfluid.min, use the incoming"size"value as the max.fluid.minbut there is afluid.max, usesize * min_size_factoras the min. Here we do enforce the lower bound rule of>16px, because Gutenberg is computing the min value. This is consistent with the way we calculate minimum sizes for single or custom values.Testing
Using theme 2023
Add some text blocks to the editor, apply presets and custom sizes, and ensure they appear as they should in the editor and frontend at various viewport widths.
The size value should act at the upper bound of any clamp value.
Custom font sizes <=14px will not be clamped.
Please test by playing around with: