Text

Utility classes for text size, alignment, wrapping, and decoration. Text size and alignment support responsive breakpoint suffixes.

Text size

Size utilities apply a scale step to any element without changing the font family. Use .text-body-lg, .text-body-sm, .text-body-xs, and .text-meta.

index.htmlhtml
<p class="text-body-lg mb-3">text-body-lg — 18px / 24px</p>
<p class="text-body-sm mb-3">text-body-sm — 14px / 24px</p>
<p class="text-body-xs mb-3">text-body-xs — 12px / 16px</p>
<p class="text-meta">text-meta — 12px / 16px, mono font</p>

text-body-lg — 18px / 24px

text-body-sm — 14px / 24px

text-body-xs — 12px / 16px

text-meta — 12px / 16px, mono font

Responsive text size

Combine a base size with a responsive override. The suffixed class applies from the named breakpoint upward.

index.htmlhtml
<p class="text-body-sm text-body-lg@md mb-3">Small on mobile, large from md up</p>
<p class="text-meta text-body-lg@lg">Meta on mobile, large from lg up</p>

Small on mobile, large from md up

Meta on mobile, large from lg up

Text alignment

Use .text-start, .text-center, and .text-end to control text alignment. These utilities support responsive suffixes (@sm, @md, @lg, @xl, @2xl).

index.htmlhtml
<p class="text-start border p-2 mb-3">Left-aligned text (default).</p>
<p class="text-center border p-2 mb-3">Centre-aligned text.</p>
<p class="text-end border p-2">Right-aligned text.</p>

Left-aligned text (default).

Centre-aligned text.

Right-aligned text.

Responsive text alignment

Combine a base alignment with a responsive override. The suffixed class applies from the named breakpoint upward.

index.htmlhtml
<!-- Left on mobile, centred from md up -->
<p class="text-start text-center@md border p-2 mb-3">Centred from md up.</p>

<!-- Centred by default, right-aligned from lg up -->
<p class="text-center text-end@lg border p-2">Right-aligned from lg up.</p>

Centred from md up.

Right-aligned from lg up.

Text wrapping

Control how text wraps within its container. These utilities are not responsive.

index.htmlhtml
<p class="text-wrap border p-2 mb-3">Text with default wrapping behaviour.</p>
<p class="text-nowrap border p-2 mb-3">Text that will not wrap to a new line.</p>
<p class="text-balance border p-2 mb-3">Text balanced across lines for even line lengths.</p>
<p class="text-pretty border p-2">Text with optimised line breaks to avoid orphans.</p>

Text with default wrapping behaviour.

Text that will not wrap to a new line.

Text balanced across lines for even line lengths.

Text with optimised line breaks to avoid orphans.

Text decoration

Override or remove text decoration. Useful for removing underlines from links or adding strikethrough to deleted content.

index.htmlhtml
<a href="#" class="text-decoration-none mb-3 d-block">Link with no underline</a>
<span class="text-decoration-underline mb-3 d-block">Underlined text</span>
<span class="text-decoration-line-through">Struck-through text</span>
Link with no underlineUnderlined textStruck-through text

Reference

ClassPropertyResponsive
.text-body-lgfont-size: var(--t-body-lg-s)Yes
.text-body-smfont-size: var(--t-body-sm-s)Yes
.text-body-xsfont-size: var(--t-body-xs-s)Yes
.text-metafont-size: var(--t-meta-s)Yes
.text-starttext-align: startYes
.text-centertext-align: centerYes
.text-endtext-align: endYes
.text-wraptext-wrap: wrapNo
.text-nowraptext-wrap: nowrapNo
.text-balancetext-wrap: balanceNo
.text-prettytext-wrap: prettyNo
.text-decoration-nonetext-decoration: noneNo
.text-decoration-underlinetext-decoration: underlineNo
.text-decoration-line-throughtext-decoration: line-throughNo