
滤镜
将棕褐色滤镜应用于元素的工具。
¥Basic usage
¥Adding sepia filters
使用 sepia 和 sepia-0 工具来控制元素是应该渲染为棕褐色还是全彩色。
¥Use the sepia and sepia-0 utilities to control whether an element should be rendered as sepia or in full color.
sepia-0
sepia
<div class="sepia-0 ...">
<!-- ... -->
</div>
<div class="sepia ...">
<!-- ... -->
</div>
¥Removing filters
要一次删除元素上的所有过滤器,请使用 filter-none 工具:
<div class="blur-md invert sepia md:filter-none">
<!-- ... -->
</div>
当想要有条件地删除过滤器时(例如悬停时或在特定断点处),此工具很有用。
Tailwind 允许你使用变体修饰符在不同状态下有条件地应用工具类。例如,使用hover:sepia-0 仅在 hover 时应用 sepia-0 工具。
<div class="sepia hover:sepia-0">
<!-- ... -->
</div>
有关所有可用状态修饰符的完整列表,请查看悬停、聚焦、以及其他状态 文档。
你还可以使用变体修饰符来定位媒体查询,例如响应式断点、暗黑模式、首选减少运动等。例如,使用 md:sepia-0 仅在中等屏幕尺寸及以上时应用 sepia-0 工具。
<div class="sepia md:sepia-0">
<!-- ... -->
</div>
要了解更多信息,请查看有关 响应式设计、暗黑模式、以及 其他媒体查询修饰符 的文档。
¥Using custom values
¥Customizing your theme
默认情况下,Tailwind 包含一些通用 sepia 工具。你可以通过编辑 tailwind.config.js 文件中的 theme.sepia 或 theme.extend.sepia 来自定义这些值。
¥By default, Tailwind includes a handful of general purpose sepia utilities. You can customize these values by editing theme.sepia or theme.extend.sepia in your tailwind.config.js file.
module.exports = {
theme: {
extend: {
sepia: {
25: '.25',
75: '.75',
}
}
}
}
在 主题定制 文档中了解有关自定义默认主题的更多信息。
¥Learn more about customizing the default theme in the theme customization documentation.
¥Arbitrary values
如果你需要使用一次性的 sepia 值,而该值没有必要包含在你的主题中,请使用方括号动态生成属性,使用任意值。
<div class="sepia-[.25]">
<!-- ... -->
</div>
在 任意值 文档中了解有关任意值支持的更多信息。