【tailwind】ふわっと背景色が切り替わるアニメーションを実装する
1080 ワード
自分の実装力を上げるためスクラッチで、Vuetifyのカレンダーコンポーネントのようなものを作っています。
今日はtailwindcssを使って日付ラベルをhover時にふわっと背景色が切り替わるアニメーションを実装したので、備忘録を残しておきます。
<div :class="{ 'text-red-default' : isToday(day) }" class="text-center">
<span class="rounded-full transition duration-500 ease-in-out cursor-pointer inline-block w-6 h-6 hover:bg-grey-light">
{{ day.label }}
</span>
</div>
classにtransition
duration-500
ease-in-out
を指定するとgifのようにふわっと背景色が切り替わるようになります。
Author And Source
この問題について(【tailwind】ふわっと背景色が切り替わるアニメーションを実装する), 我々は、より多くの情報をここで見つけました https://qiita.com/tommy0218/items/af645c24587d307ae69d著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .