Typography

text-decoration-thickness

Setting thickness of the decoration line.

Overview

ClassDeclarations
text-decoration:from-font-webkit-text-decoration: from-font; text-decoration: from-font;
text-decoration-thickness:<size>text-decoration-thickness: <size>;

Examples

Set decoration thickness

Use text-decoration-thickness:* to control underline, overline, or line-through weight.

<a class="underline text-decoration-thickness:2px">  Strong underline</a>
Generated CSS
@layer utilities {  .text-decoration-thickness\:2px {    text-decoration-thickness: 2px  }}

Use font-provided thickness

Use text-decoration:from-font when the typeface provides an underline thickness that should be respected.

<a class="underline text-decoration:from-font">  Typeface underline</a>

Pair with underline offset

Thicker decorations usually need a slightly larger text-underline-offset.

<a class="underline text-decoration-thickness:2px text-underline:3xs">  Balanced underline</a>

Apply conditionally

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

<a class="text-decoration-thickness:2px:hover text-decoration-thickness:1px@print text-decoration:from-font@sm">...</a>


© 2026 Aoyue Design LLC.MIT License
Trademark Policy