tailwindcss-animate.css 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. /**
  2. * TailwindCSS v4.0 compatible replacement for `tailwindcss-animate`.
  3. *
  4. * WARNING: The asterisks are not supported by some formatters and linters. You
  5. * might want to exclude this file from formatters and linters for now.
  6. *
  7. * @author Luca Bosin <https://github.com/Wombosvideo>
  8. * @license MIT
  9. */
  10. @theme inline {
  11. --animation-delay-0: 0s;
  12. --animation-delay-75: 75ms;
  13. --animation-delay-100: 0.1s;
  14. --animation-delay-150: 0.15s;
  15. --animation-delay-200: 0.2s;
  16. --animation-delay-300: 0.3s;
  17. --animation-delay-500: 0.5s;
  18. --animation-delay-700: 0.7s;
  19. --animation-delay-1000: 1s;
  20. --animation-repeat-0: 0;
  21. --animation-repeat-1: 1;
  22. --animation-repeat-infinite: infinite;
  23. --animation-direction-normal: normal;
  24. --animation-direction-reverse: reverse;
  25. --animation-direction-alternate: alternate;
  26. --animation-direction-alternate-reverse: alternate-reverse;
  27. --animation-fill-mode-none: none;
  28. --animation-fill-mode-forwards: forwards;
  29. --animation-fill-mode-backwards: backwards;
  30. --animation-fill-mode-both: both;
  31. --animate-in: var(--tw-duration, 150ms) var(--tw-ease, ease) enter;
  32. --animate-out: var(--tw-duration, 150ms) var(--tw-ease, ease) exit;
  33. --percentage-0: 0;
  34. --percentage-5: 0.05;
  35. --percentage-10: 0.1;
  36. --percentage-15: 0.15;
  37. --percentage-20: 0.2;
  38. --percentage-25: 0.25;
  39. --percentage-30: 0.3;
  40. --percentage-35: 0.35;
  41. --percentage-40: 0.4;
  42. --percentage-45: 0.45;
  43. --percentage-50: 0.5;
  44. --percentage-55: 0.55;
  45. --percentage-60: 0.6;
  46. --percentage-65: 0.65;
  47. --percentage-70: 0.7;
  48. --percentage-75: 0.75;
  49. --percentage-80: 0.8;
  50. --percentage-85: 0.85;
  51. --percentage-90: 0.9;
  52. --percentage-95: 0.95;
  53. --percentage-100: 1;
  54. --translate-1/2: 50%;
  55. --translate-1/3: 33.333333%;
  56. --translate-2/3: 66.666667%;
  57. --translate-1/4: 25%;
  58. --translate-2/4: 50%;
  59. --translate-3/4: 75%;
  60. --translate-full: 100%;
  61. --translate-px: 1px;
  62. --translate-0: 0px;
  63. --translate-0.5: 0.125rem;
  64. --translate-1: 0.25rem;
  65. --translate-1.5: 0.375rem;
  66. --translate-2: 0.5rem;
  67. --translate-2.5: 0.625rem;
  68. --translate-3: 0.75rem;
  69. --translate-3.5: 0.875rem;
  70. --translate-4: 1rem;
  71. --translate-5: 1.25rem;
  72. --translate-6: 1.5rem;
  73. --translate-7: 1.75rem;
  74. --translate-8: 2rem;
  75. --translate-9: 2.25rem;
  76. --translate-10: 2.5rem;
  77. --translate-11: 2.75rem;
  78. --translate-12: 3rem;
  79. --translate-14: 3.5rem;
  80. --translate-16: 4rem;
  81. --translate-20: 5rem;
  82. --translate-24: 6rem;
  83. --translate-28: 7rem;
  84. --translate-32: 8rem;
  85. --translate-36: 9rem;
  86. --translate-40: 10rem;
  87. --translate-44: 11rem;
  88. --translate-48: 12rem;
  89. --translate-52: 13rem;
  90. --translate-56: 14rem;
  91. --translate-60: 15rem;
  92. --translate-64: 16rem;
  93. --translate-72: 18rem;
  94. --translate-80: 20rem;
  95. --translate-96: 24rem;
  96. @keyframes enter {
  97. from {
  98. opacity: var(--tw-enter-opacity, 1);
  99. transform: translate3d(
  100. var(--tw-enter-translate-x, 0),
  101. var(--tw-enter-translate-y, 0),
  102. 0
  103. )
  104. scale3d(
  105. var(--tw-enter-scale, 1),
  106. var(--tw-enter-scale, 1),
  107. var(--tw-enter-scale, 1)
  108. )
  109. rotate(var(--tw-enter-rotate, 0));
  110. }
  111. }
  112. @keyframes exit {
  113. to {
  114. opacity: var(--tw-exit-opacity, 1);
  115. transform: translate3d(
  116. var(--tw-exit-translate-x, 0),
  117. var(--tw-exit-translate-y, 0),
  118. 0
  119. )
  120. scale3d(
  121. var(--tw-exit-scale, 1),
  122. var(--tw-exit-scale, 1),
  123. var(--tw-exit-scale, 1)
  124. )
  125. rotate(var(--tw-exit-rotate, 0));
  126. }
  127. }
  128. }
  129. /*
  130. * Tailwind's default `duration` utility sets the `--tw-duration` variable, so
  131. * can set `animation-duration` directly in the animation definition in the
  132. * `@theme` section above. Same goes for the `animation-timing-function`, set
  133. * with `--tw-ease`.
  134. */
  135. @utility delay-* {
  136. animation-delay: calc(--value(number) * 1ms);
  137. animation-delay: --value(--animation-delay-*, [duration], [*]);
  138. }
  139. @utility repeat-* {
  140. animation-iteration-count: --value(--animation-repeat-*, integer);
  141. }
  142. @utility direction-* {
  143. animation-direction: --value(--animation-direction-*);
  144. }
  145. @utility fill-mode-* {
  146. animation-fill-mode: --value(--animation-fill-mode-*);
  147. }
  148. @utility running {
  149. animation-play-state: running;
  150. }
  151. @utility paused {
  152. animation-play-state: paused;
  153. }
  154. @utility fade-in {
  155. --tw-enter-opacity: 0;
  156. }
  157. @utility fade-in-* {
  158. --tw-enter-opacity: --value(--percentage-*, [*]);
  159. }
  160. @utility fade-out {
  161. --tw-exit-opacity: 0;
  162. }
  163. @utility fade-out-* {
  164. --tw-exit-opacity: --value(--percentage-*, [*]);
  165. }
  166. @utility zoom-in {
  167. --tw-enter-scale: 0;
  168. }
  169. @utility zoom-in-* {
  170. --tw-enter-scale: calc(--value([percentage]) / 100%);
  171. --tw-enter-scale: calc(--value([ratio], [number]));
  172. --tw-enter-scale: --value(--percentage-*);
  173. }
  174. @utility zoom-out {
  175. --tw-exit-scale: 0;
  176. }
  177. @utility zoom-out-* {
  178. --tw-exit-scale: calc(--value([percentage]) / 100%);
  179. --tw-exit-scale: calc(--value([ratio], [number]));
  180. --tw-exit-scale: --value(--percentage-*);
  181. }
  182. @utility spin-in {
  183. --tw-enter-rotate: 30deg;
  184. }
  185. @utility spin-in-* {
  186. --tw-enter-rotate: calc(--value(number) * 1deg);
  187. --tw-enter-rotate: --value(--rotate-*, [angle]);
  188. }
  189. @utility spin-out {
  190. --tw-exit-rotate: 30deg;
  191. }
  192. @utility spin-out-* {
  193. --tw-exit-rotate: calc(--value(number) * 1deg);
  194. --tw-exit-rotate: --value(--rotate-*, [angle]);
  195. }
  196. @utility slide-in-from-top {
  197. --tw-enter-translate-y: -100%;
  198. }
  199. @utility slide-in-from-top-* {
  200. --tw-enter-translate-y: calc(--value(integer) * var(--spacing) * -1);
  201. --tw-enter-translate-y: calc(--value(--translate-*, [percentage], ratio, [length]) * -1);
  202. }
  203. @utility slide-in-from-bottom {
  204. --tw-enter-translate-y: 100%;
  205. }
  206. @utility slide-in-from-bottom-* {
  207. --tw-enter-translate-y: calc(--value(integer) * var(--spacing));
  208. --tw-enter-translate-y: --value(--translate-*, [percentage], ratio, [length]);
  209. }
  210. @utility slide-in-from-left {
  211. --tw-enter-translate-x: -100%;
  212. }
  213. @utility slide-in-from-left-* {
  214. --tw-enter-translate-x: calc(--value(integer) * var(--spacing) * -1);
  215. --tw-enter-translate-x: calc(--value(--translate-*, [percentage], ratio, [length]) * -1);
  216. }
  217. @utility slide-in-from-right {
  218. --tw-enter-translate-x: 100%;
  219. }
  220. @utility slide-in-from-right-* {
  221. --tw-enter-translate-x: calc(--value(integer) * var(--spacing));
  222. --tw-enter-translate-x: --value(--translate-*, [percentage], ratio, [length]);
  223. }
  224. @utility slide-out-to-top {
  225. --tw-exit-translate-y: -100%;
  226. }
  227. @utility slide-out-to-top-* {
  228. --tw-exit-translate-y: calc(--value(integer) * var(--spacing) * -1);
  229. --tw-exit-translate-y: calc(--value(--translate-*, [percentage], ratio, [length]) * -1);
  230. }
  231. @utility slide-out-to-bottom {
  232. --tw-exit-translate-y: 100%;
  233. }
  234. @utility slide-out-to-bottom-* {
  235. --tw-exit-translate-y: calc(--value(integer) * var(--spacing));
  236. --tw-exit-translate-y: --value(--translate-*, [percentage], ratio, [length]);
  237. }
  238. @utility slide-out-to-left {
  239. --tw-exit-translate-x: -100%;
  240. }
  241. @utility slide-out-to-left-* {
  242. --tw-exit-translate-x: calc(--value(integer) * var(--spacing) * -1);
  243. --tw-exit-translate-x: calc(--value(--translate-*, [percentage], ratio, [length]) * -1);
  244. }
  245. @utility slide-out-to-right {
  246. --tw-exit-translate-x: 100%;
  247. }
  248. @utility slide-out-to-right-* {
  249. --tw-exit-translate-x: calc(--value(integer) * var(--spacing));
  250. --tw-exit-translate-x: --value(--translate-*, [percentage], ratio, [length]);
  251. }