Syntax

font-size

Setting the font size of elements.

Overview

ClassDeclarations
font:3xsfont-size: 0.5rem;
font:2xsfont-size: 0.625rem;
font:xsfont-size: 0.75rem;
font:smfont-size: 0.875rem;
font:mdfont-size: 1rem;
font:lgfont-size: 1.125rem;
font:xlfont-size: 1.25rem;
font:2xlfont-size: 1.5rem;
font:3xlfont-size: 2rem;
font:4xlfont-size: 2.25rem;
font:5xlfont-size: 2.5rem;
font:6xlfont-size: 3rem;
font:7xlfont-size: 3.75rem;
font:8xlfont-size: 4.5rem;
font:9xlfont-size: 6rem;
font:10xlfont-size: 8rem;
font-size:<size>font-size: <size>/16rem;

Examples

Basic usage

Use font size tokens like font:xs, font:sm, and font:md to set the font size of an element.

font:xs
Sphinx of black quartz, judge my vow.
font:sm
Sphinx of black quartz, judge my vow.
font:md
Sphinx of black quartz, judge my vow.
font:lg
Sphinx of black quartz, judge my vow.
font:xl
Sphinx of black quartz, judge my vow.
font:2xl
Sphinx of black quartz, judge my vow.
<div class="font:xs">Sphinx of black quartz, judge my vow.</div><div class="font:sm">Sphinx of black quartz, judge my vow.</div><div class="font:md">Sphinx of black quartz, judge my vow.</div><div class="font:lg">Sphinx of black quartz, judge my vow.</div><div class="font:xl">Sphinx of black quartz, judge my vow.</div><div class="font:2xl">Sphinx of black quartz, judge my vow.</div>

With line height

Set the line height, use the leading:<size> syntax along with the font size.

<div class="font:md leading:1.2">Sphinx of black quartz, judge my vow.</div>

You can also use the text:<size> syntax to set the line height and font size together.

Apply conditionally

Apply styles based on different states using selectors and conditional queries.

<div class="font:16:hover font:16@sm font:16@dark font:16@print">…</div>

  • Master UI


© 2025 Aoyue Design LLC.MIT License
Trademark Policy