語法

行高line-height

Setting the height of a line box.

Overview

ClassDeclarations
leading:1line-height: 1;
leading:xsline-height: 1.2;
leading:smline-height: 1.4;
leading:mdline-height: 1.6;
leading:lgline-height: 1.8;
leading:xlline-height: 2;
leading:<size>line-height: <size>;

Examples

Basic usage

Use the predefined line height tokens like leading:xs, leading:sm, and leading:lg to set the line height of an element.

leading:xs
Design is not just about aesthetics—it’s about communication. Proper font sizes and spacing help present information clearly and improve usability.
leading:sm
Design is not just about aesthetics—it’s about communication. Proper font sizes and spacing help present information clearly and improve usability.
leading:md
Design is not just about aesthetics—it’s about communication. Proper font sizes and spacing help present information clearly and improve usability.
leading:lg
Design is not just about aesthetics—it’s about communication. Proper font sizes and spacing help present information clearly and improve usability.
leading:xl
Design is not just about aesthetics—it’s about communication. Proper font sizes and spacing help present information clearly and improve usability.
<div class="leading:xs">Design is not just about aesthetics—it’s...</div><div class="leading:sm">Design is not just about aesthetics—it’s...</div><div class="leading:md">Design is not just about aesthetics—it’s...</div><div class="leading:lg">Design is not just about aesthetics—it’s...</div><div class="leading:xl">Design is not just about aesthetics—it’s...</div>

You can also use text:<size> to set a text size with a golden ratio line height.

Apply conditionally

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

<div class="leading:1:hover leading:1@sm leading:1@dark leading:1@print">…</div>

  • Master UI


© 2025 Aoyue Design LLC.MIT License
Trademark Policy