Closed porg closed 1 year ago
Hi @porg,
At the time you reported this issue, the wideSize
was indeed taken into account in the fluid typography calculation, but I believe the small viewport width was a fixed value.
However, #53081 would allow you to define minimum and maximum viewport widths. This should be included in Gutenberg plugin 16.5, so please give it a try when that version is released.
I would like to close this issue, but if I have missed something, please comment.
Yes the linked PR fixes the main aspects of my issue.
I also left a comment there on my remaining open concern that:
it should be possible that
minViewportWidth
andmaxViewportWidth
can take variable values likecontentSize
andwideSize
or the defined breakpoint variables to have a synchronized design experience with no need to manually update numerical values in multiple places.
Please tune into that last open discussion point there. Thanks.
Description
As I understood it, the fluid typography feature in
theme.json
allows one to just set amin
and amax
per eachfluid
enabled font size definition atsettings
→typography
→fontSizes
, and the system derives/calculates the necessaryclamp()
function by correlating the min/max values against: settings → layout:contentSize
+wideSize
.→ https://css-tricks.com/fluid-typography-wordpress-block-themes/#aa-declaring-fluid-type-in-a-wordpress-block-theme
I checked the calculated font size at different viewports both in Safari, Chrome:
contentSize
(650px in my TT3) but instead only when reaching320px
.clamp()
function is falsely correlating themin
value against the hardcoded value of 320px (a small mobile viewport, e.g. iPhone SE) instead of being based oncontentSize
.wideSize
(well almost, forgiving some decimal precision)17.997px
.Step-by-step reproduction instructions
theme.json
Derived CSS
Screenshots, screen recording, code snippet
Spreadsheet calculations/observations: fluid-typography.xlsx
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
No