行高

用于控制行高的工具类,包括紧凑、正常和宽松的间距。

ClassStyles
.lh-1line-height: 1;
.lh-smline-height: var(--bs-line-height-sm);
.lh-mdline-height: var(--bs-line-height-md);
.lh-lgline-height: var(--bs-line-height-lg);

行高

使用 .lh-* 工具类更改行高。

This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.

This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.

This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.

This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.

HTML
<p class="lh-1">This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.</p>
<p class="lh-sm">This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.</p>
<p class="lh-md">This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.</p>
<p class="lh-lg">This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.</p>

CSS

Sass 工具类 API

行高工具类在我们的工具类 API 中于 scss/_utilities.scss 内声明。了解如何使用工具类 API。

"line-height": (
  property: line-height,
  class: lh,
  values: (
    1: 1,
    sm: var(--line-height-sm),
    md: var(--line-height-md),
    lg: var(--line-height-lg),
  )
),