--- title: Dynamic font size description: The Dynamic Font Size utility scales an element’s base font size based on container width. --- Use Dynamic font size to scale the base font size of an element. Any element children using relative font sizes will scale proportionally. A [container element](/utils/container/) is required as a wrapper. There are set widths for the container where the scaling starts and stops. The scaling and width parameters may be controlled using modifer classnames as described below. The default values are a scaling factor of `1 – 1.25` between widths `400px – 750px`.
This text will resize dynamically depending on the width of the containment context. Baseline font-size will go from 1em to 1.25em starting at 400px width up to 750px. The heading will also scale to a factor of 1.25, but starting at 1.25em it will scale up to 1.5625em.
Resize container (px) →
This text will resize!
This text will resize ...
Scaling factor 1.125
Scaling factor 1.25 (default)
Scaling factor 1.375
Scaling factor 1.5
Scaling factor 1.625
Scaling factor 1.75
Scaling factor 1.875
Scaling factor 2
Resize container (px) →
Scaling factor 1.125
From 250 to 500
From 400 to 650
From 550 to 800
Resize container (px) →
From 250 to 500
Upscaling factor 1.25 (default)
Upscaling factor 2
Downscaling factor 1.25
Downscaling factor 2
Resize container (px) →
Upscaling factor 1.25 (default)
Upscaling factor 2
Downscaling factor 1.25
Downscaling factor 2
Scaling factor 1.2345