Effects

Fluid Font Size

Utilities for sets min and max font sizes for screen size without breakpoints.


Variant

Active Checked Child-Selection Dark Mode Disabled Expand First-Last-Selection First-Letter Focus Focus-Visible Focus-Within Fullscreen Group-Focus Group-Hover Hover Landscape Light Mode Portrait Reduce-Motion Responsive Selection-Hover Visited

API

classcss
fluid text-min-{value} text-max-{value}@media screen and (min-width: 20rem) { .fluid.text-min-{modifier}.text-max-{modifier} { font-size: calc({min} + 0 * ((100vw - 20rem) / 30)) } } @media screen and (min-width: 50rem) { .fluid.text-min-{modifier}.text-max-{modifier} { font-size: {max} } }
classcss
xsfont-size: .75remText
smfont-size: .875remText
mdfont-size: 1remText
lgfont-size: 1.125remText
xl-1font-size: 1.25remText
xl-2font-size: 1.5remText
xl-3font-size: 1.875remText
xl-4font-size: 2.25remText
xl-5font-size: 3remText
xl-6font-size: 4remText
xl-7font-size: 5remText
xl-8font-size: 6remText

Usage

Set font size adaptively to the width of the screen size. When the smaller screen size, the text size is text-lg at min. Meanwhile, when the screen size is getting bigger, the text size is text-md at max.

<div class="fluid text-min-lg text-max-md">
...
</div>
HTML
.dummy {
@extend
.fluid,
.text-min-lg,
.text-max-md;
}
SCSS

Mix with other fluid utilities, such as Fluid Margin, Fluid Padding.

<div class="fluid margin-min-4 margin-max-2 padding-min-8 padding-max-4 text-min-lg text-max-md">
...
</div>
HTML
.dummy {
@extend
.fluid,
.margin-min-4,
.margin-max-2,
.padding-min-8,
.padding-max-4,
.text-min-lg,
.text-max-md;
}
SCSS