
排版
用于控制文本装饰粗细的工具。
使用 decoration-* 工具更改元素的text 装饰的粗细。
🌐 Use the decoration-* utilities to change the thickness of an element’s text decoration.
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>
Tailwind 允许你使用变体修饰符在不同状态下有条件地应用工具类。例如,使用hover:decoration-4 仅在 hover 时应用 decoration-4 工具。
<p class="underline hover:decoration-4">
<!-- ... -->
</p>
有关所有可用状态修饰符的完整列表,请查看悬停、聚焦、以及其他状态 文档。
你还可以使用变体修饰符来定位媒体查询,例如响应式断点、暗黑模式、首选减少运动等。例如,使用 md:decoration-4 仅在中等屏幕尺寸及以上时应用 decoration-4 工具。
<p class="underline md:decoration-4">
<!-- ... -->
</p>
要了解更多信息,请查看有关 响应式设计、暗黑模式、以及 其他媒体查询修饰符 的文档。
你可以通过编辑 tailwind.config.js 文件中的 theme.textDecorationThickness 或 theme.extend.textDecorationThickness 来自定义 decoration-* 工具。
🌐 You can customize the decoration-* utilities by editing theme.textDecorationThickness or theme.extend.textDecorationThickness in your tailwind.config.js file.
module.exports = {
theme: {
extend: {
textDecorationThickness: {
3: '3px',
}
}
}
}
在主题自定义文档中了解有关自定义默认主题的更多信息。
🌐 Learn more about customizing the default theme in the theme customization documentation.
如果你需要使用一次性的 text-decoration-thickness 值,而该值没有必要包含在你的主题中,请使用方括号动态生成属性,使用任意值。
<p class="decoration-[3px]">
<!-- ... -->
</p>
在 任意值 文档中了解有关任意值支持的更多信息。