フィルター
要素の背景に hue-rotate フィルターを適用するためのユーティリティ。
クラス | スタイル |
---|---|
backdrop-hue-rotate-<number> | backdrop-filter: hue-rotate(<number>deg); |
-backdrop-hue-rotate-<number> | backdrop-filter: hue-rotate(calc(<number>deg * -1)); |
backdrop-hue-rotate-(<custom-property>) | backdrop-filter: hue-rotate(var(<custom-property>)); |
backdrop-hue-rotate-[<value>] | backdrop-filter: hue-rotate(<value>); |
要素の背景の hue を回転させるには、backdrop-hue-rotate-90
や backdrop-hue-rotate-180
などのユーティリティを使用します。
backdrop-hue-rotate-90
backdrop-hue-rotate-180
backdrop-hue-rotate-270
<div class="bg-[url(/img/mountains.jpg)]"> <div class="bg-white/30 backdrop-hue-rotate-90 ..."></div></div><div class="bg-[url(/img/mountains.jpg)]"> <div class="bg-white/30 backdrop-hue-rotate-180 ..."></div></div><div class="bg-[url(/img/mountains.jpg)]"> <div class="bg-white/30 backdrop-hue-rotate-270 ..."></div></div>
負の背景 hue 回転値を設定するには、-backdrop-hue-rotate-90
や -backdrop-hue-rotate-180
などのユーティリティを使用します。
-backdrop-hue-rotate-15
-backdrop-hue-rotate-45
-backdrop-hue-rotate-90
<div class="bg-[url(/img/mountains.jpg)]"> <div class="bg-white/30 -backdrop-hue-rotate-15 ..."></div></div><div class="bg-[url(/img/mountains.jpg)]"> <div class="bg-white/30 -backdrop-hue-rotate-45 ..."></div></div><div class="bg-[url(/img/mountains.jpg)]"> <div class="bg-white/30 -backdrop-hue-rotate-90 ..."></div></div>
backdrop-hue-rotate backdrop-hue-rotate-[<value>]
構文 を使用して、背景の hue 回転を完全にカスタム値に基づいて設定します。
<div class="backdrop-hue-rotate-[3.142rad] ..."> <!-- ... --></div>
CSS 変数の場合は、 backdrop-hue-rotate-(<custom-property>)
構文
<div class="backdrop-hue-rotate-(--my-backdrop-hue-rotation) ..."> <!-- ... --></div>
も使用できます。これは backdrop-hue-rotate-[var(<custom-property>)]
のショートハンドであり、var()
関数を自動的に追加します。
プレフィックスa backdrop-filter: hue-rotate()
ユーティリティ に md:
のようなブレークポイントバリアントをプレフィックスとして付けると、ユーティリティをmedium スクリーンサイズ以上でのみ適用できます。
<div class="backdrop-hue-rotate-15 md:backdrop-hue-rotate-0 ..."> <!-- ... --></div>
バリアントの使用方法の詳細については、バリアントドキュメントをご覧ください。