Closed TylerAPfledderer closed 2 years ago
The PR closing this issue will only add the functionality to the Heading
component's sizes
object, and not the fontSizes
object.
The latter may either be addressed at a later time with a new issue created, or suspended indefinitely. (Considering the former)
With the
clamp()
CSS function having majority browser support, it can be used to ease font transitions from large screens to small screens.It can serve two purposes:
Due some intended designs and potential quirky results, this can be considered as an optional addition, where a prop could enable the option.
If
clamp
is to not be used, than the sizing will be generated via the technique Chakra uses, with an array that denotes each type of breakpoint specified in the theme.For example, with the
Heading
component'ssizes
object, either renderOr...
And create configurations to allow for different minimum and maximum viewports to constrain the clamp to. (Really should say the same when using an array)
This is a selfish addition, but there are many articles that argue for fluid typography to allow better change in font-size but only considering the smallest and largest viewports instead of breakpoints. Whether or not it is effective depends on the design a developer works with. Ideally, if the designer used fluid type, then the developer should use it, and
clamp()
helps with that.