Backport: Fluid typography - adjust font size min and max rules (#45536) #3602
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.min
value has been specified, the lower bound rule of>16px
won't be enforced on this value. Presets with a fluid object therefore, give precedence to theme author's values.fluid.max
but there isfluid.min
, use the incoming"size"
value as the max.fluid.min
but there is afluid.max
, usesize * min_size_factor
as 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: