Created
May 8, 2020 12:33
-
-
Save minimul/3ab99574779c8113a840a178c4876486 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "tailwindcss/base"; | |
@import "tailwindcss/components"; | |
@import "tailwindcss/utilities"; | |
@import "animate.css/animate.css"; | |
/* Utility classes for animation speeds */ | |
$speeds: 100, 150, 200, 250, 300, 350, 400; | |
@each $speed in $speeds { | |
.speed-#{$speed} { | |
animation-duration: #{$speed}ms; | |
} | |
} | |
// Here we apply TailwindUIs transform recommendation for opening a dropdown | |
@keyframes dropIn { | |
from { @apply transform opacity-0 scale-95; } | |
to { @apply transform opacity-100 scale-100; } | |
} | |
.dropIn { | |
// Just add the animation-name as the speed will be adjusted | |
// via the speed-* utility classes made above. | |
animation-name: dropIn; | |
} | |
// Here we apply TailwindUIs transform recommendation for closing a dropdown | |
@keyframes dropOut { | |
from { @apply transform opacity-100 scale-100; } | |
to { @apply transform opacity-0 scale-95; } | |
} | |
.dropOut { | |
animation-name: dropOut; | |
} | |
@keyframes wiggle { | |
0% { transform: translate(2px, 0); } | |
50% { transform: translate(-2px, 0); } | |
100% { transform: translate(2px, 0); } | |
} | |
// Make the utility class notification so when an element is hover | |
// over it will "wiggle". | |
.hover-wiggle { | |
&:hover { | |
animation: wiggle 75ms; | |
animation-timing-function: linear; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment