Typography
用於控制文字裝飾粗細的通用類別。
| Class | Styles |
|---|---|
decoration-<number> | text-decoration-thickness: <number>px; |
decoration-from-font | text-decoration-thickness: from-font; |
decoration-auto | text-decoration-thickness: auto; |
decoration-(length:<custom-property>) | text-decoration-thickness: var(<custom-property>); |
decoration-[<value>] | text-decoration-thickness: <value>; |
使用 decoration-2 和 decoration-4 等 decoration-<number> 通用類別來變更元素的文字裝飾粗細:
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
<p class="underline decoration-1">The quick brown fox...</p><p class="underline decoration-2">The quick brown fox...</p><p class="underline decoration-4">The quick brown fox...</p>使用 decoration-[<value>] 語法,根據完全自訂的值來設定 text decoration thickness:
<p class="decoration-[0.25rem] ..."> Lorem ipsum dolor sit amet...</p>對於 CSS 變數,你也可以使用 decoration-(length:<custom-property>) 語法:
<p class="decoration-(length:--my-decoration-thickness) ..."> Lorem ipsum dolor sit amet...</p>這只是 decoration-[length:var(<custom-property>)] 的簡寫形式,會自動為你加上 var() 函式。
在 text-decoration-thickness 通用類別前面加上像 md: 這樣的中斷點變體,讓該通用類別只在中型螢幕尺寸及以上時套用:
<p class="underline md:decoration-4 ..."> Lorem ipsum dolor sit amet...</p>在變體文件中了解更多關於使用變體的資訊。