
排版
用于控制文本转换的工具。
uppercase 和 lowercase 分别用于将文本转换为大写和小写,而 capitalize 工具则会将文本转换为标题式大小写。normal-case 工具可以用来保留原始大小写——通常用于在不同的分隔点重置大小写。
🌐 The uppercase and lowercase will uppercase and lowercase text respectively, whereas capitalize utility will convert text to title-case. The normal-case utility can be used to preserve the original casing — typically to reset capitalization at different breakpoints.
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.
The quick brown fox jumps over the lazy dog.
<p class="normal-case ...">The quick brown fox ...</p>
<p class="uppercase ...">The quick brown fox ...</p>
<p class="lowercase ...">The quick brown fox ...</p>
<p class="capitalize ...">The quick brown fox ...</p>
Tailwind 允许你使用变体修饰符在不同状态下有条件地应用工具类。例如,使用hover:uppercase 仅在 hover 时应用 uppercase 工具。
<p class="capitalize hover:uppercase">
<!-- ... -->
</p>
有关所有可用状态修饰符的完整列表,请查看悬停、聚焦、以及其他状态 文档。
你还可以使用变体修饰符来定位媒体查询,例如响应式断点、暗黑模式、首选减少运动等。例如,使用 md:uppercase 仅在中等屏幕尺寸及以上时应用 uppercase 工具。
<p class="capitalize md:uppercase">
<!-- ... -->
</p>