W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
將色調(diào)旋轉(zhuǎn)濾鏡應(yīng)用于元素的實用程序。
Class
|
Properties
|
---|---|
-hue-rotate-180 | --tw-hue-rotate: hue-rotate(-180deg); |
-hue-rotate-90 | --tw-hue-rotate: hue-rotate(-90deg); |
-hue-rotate-60 | --tw-hue-rotate: hue-rotate(-60deg); |
-hue-rotate-30 | --tw-hue-rotate: hue-rotate(-30deg); |
-hue-rotate-15 | --tw-hue-rotate: hue-rotate(-15deg); |
hue-rotate-0 | --tw-hue-rotate: hue-rotate(0deg); |
hue-rotate-15 | --tw-hue-rotate: hue-rotate(15deg); |
hue-rotate-30 | --tw-hue-rotate: hue-rotate(30deg); |
hue-rotate-60 | --tw-hue-rotate: hue-rotate(60deg); |
hue-rotate-90 | --tw-hue-rotate: hue-rotate(90deg); |
hue-rotate-180 | --tw-hue-rotate: hue-rotate(180deg); |
在 ?filter
?實用程序旁邊使用 ?hue-rotate-{amount}
? 實用程序來旋轉(zhuǎn)元素的色調(diào)。
<div class="filter hue-rotate-15 ...">
<!-- ... -->
</div>
要在特定斷點處控制元素的色調(diào)旋轉(zhuǎn),請在任何現(xiàn)有的色調(diào)旋轉(zhuǎn)實用程序中添加 ?{screen}:
? 前綴。例如,使用 ?md:hue-rotate-60
? 將 ?hue-rotate-60
? 實用程序僅應(yīng)用于中等大小及以上的屏幕尺寸。
<div class="filter hue-rotate-15 md:hue-rotate-60 ...">
<!-- ... -->
</div>
有關(guān) Tailwind 響應(yīng)式設(shè)計功能的更多信息,請查看響應(yīng)式設(shè)計文檔。
您可以使用 ?tailwind.config.js
? 文件的主題部分中的 ?hueRotate
?鍵自定義生成哪些 ?hue-rotate
? 實用程序。
// tailwind.config.js
module.exports = {
theme: {
extend: {
hueRotate: {
'-270': '-270deg',
270: '270deg',
}
}
}
}
在主題自定義文檔中了解有關(guān)自定義默認主題的更多信息。
默認情況下, 針對 hue-rotate 功能類,只生成 responsive 變體。
您可以通過修改您的 ?tailwind.config.js
? 文件中的 ?variants
?部分中的 ?hueRotate
?屬性來控制為 hue-rotate 功能生成哪些變體。
例如,這個配置也將生成 hover and focus 變體:
// tailwind.config.js
module.exports = {
variants: {
extend: {
// ...
hueRotate: ['hover', 'focus'],
}
}
}
如果您不打算在您的項目中使用 hue-rotate 功能,您可以通過在配置文件的 ?corePlugins
?部分將 ?hueRotate
?屬性設(shè)置為 ?false
?來完全禁用它們:
// tailwind.config.js
module.exports = {
corePlugins: {
// ...
hueRotate: false,
}
}
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: