Fluid Typography
Fluid Typography (or Fluid Responsive) is an idea that font size changes fluidly with the screen's width, not just changes at breakpoints.
Last updated
Fluid Typography (or Fluid Responsive) is an idea that font size changes fluidly with the screen's width, not just changes at breakpoints.
Last updated
S2 Framework adopts the modern Fluid Type Scale concept — a combination of Fluid Typography and Type Scale. To take advantage of both, we use the open-source to effortlessly generate all the clamp()
values we need.
The fluid behavior is achieved using clamp()
function in the font-size property, allowing text to scale dynamically with the viewport. And by applying a type scale ratio, we can maintain smooth, harmonious typography across screen sizes without guesswork.
Let’s take a look at the diagram below:
Once you understand the basic concept, making adjustments becomes quite easy.
🤩 Now, with the above basic knowledge, let's explore the default setup on S2.
Fluid Type Scale has been applied to the Body tag and text classes in the S2 Framework:
text-sm
, text-xs
, text-2xs
, text-3xs
,
Body
, text-base
,
text-lg
, text-xl
, text-2xl
, text-3xl
Let's take a look at the default configuration on the larger end of the scale first:
Body
= text-base
, text-lg
, text-xl
, text-2xl
, text-3xl
Min of base
Desired min of base is 1rem (16px)
Max of base
Desired max if base is 1.125rem (18rem)
Max of xl
1.5rem, which is a reasonable size
Min of 3xl
1.25rem
Max of 3xl
2rem
Here's what we get for the fluid values:
Let's move on to the smaller sizes!
text-sm
, text-xs
, text-2xs
, text-3xs
The process is similar for the smaller sizes; the min and max values of the base font size should be constant. (This time, as the sizes are quite small, it will be easier to get the desired results by using xs
as the baseline step.)
Use xs
as base
Easier to set up a scale down
base
Same value
Max of xs
0.875rem (14px)
Min of 3xs
Within a reasonable size
Here's what we get:
Fluid Type Scale has also been applied to the heading tags and classes:
Heading 1
to Heading 6
, and h1
to h6
As before, we can use the Fluid Type Scale Calculator to generate fluid values effortlessly for headings. In S2, h6
serves as the baseline step, matching the font size of Body
.
Min of h1
3rem
Max of h1
5rem
Here's what we get:
h7
, h8
Sometimes you simply need smaller headings — that's where h7
and h8
come in. These are arbitrary classes created to style smaller headings. Since their sizes are too small to benefit from fluid scaling, we use regular fixed font sizes for simplicity.
sup
, sub
S2 applies fluid font styles on sup
and sub
elements.
The generated values are applied to the Webflow Designer for the sup
and sub
tags, allowing them to scale correctly and maintain proper positioning relative to the font size.
S2 includes Font Size variables that can be easily applied to other classes and elements. To best align with the Fluid Type Scale used for tags and classes, we manually enter the font sizes in the Variables panel. Default values are already included in the cloneable.
You can use the Fluid Type Scale Calculator to get the values for each breakpoint in the preview section (scroll down). In Webflow, the default breakpoints are: 1280px, 991px, 767px, and 479px.
In S2, the fluid values have been applied directly to:
Body
, text-base
text-sm
, text-xs
, text-2xs
, text-3xs
text-lg
, text-xl
, text-2xl
, text-3xl
Heading 1
~ Heading 6
h1
~ h6
sup
, sub
Additionally, the Font Size variables also have values that can align with the Fluid Type Scale. This allows you to enjoy the benefits without relying on custom code.
If you prefer using custom CSS instead of editing the font-size values on the panel, visit:
Extended readings:
The above diagram explains the basic concept of a example:
Here is another example — a simple . This is helpful if you want to apply fluid typography to a specific class or variable.
✦
✦
✦
✦
✦
We have prepared a Fluid Sup / Sub CSS Generator for the S2 Framework. It is modified from the tool created by .
✦
We understand that manually entering all these values can be a bit cumbersome when you want to adjust font sizes. This process will become super simple once Webflow supports in the future. Hopefully, this feature will be available soon.
You can use custom CSS to scale fonts down for devices smaller than the iPhone SE (319px or below). Here is an example based on .
About clamp()
:
Fluid Typography:
Simplified Fluid Typography:
Fluid Superscripts and Subscripts: