Animation

Transition

On any change in property listed, will animate into it

Only need to add duration for most basic effect i.e

<div className="duration-150 hover:[someproperty/transformation]" />
  • Transition-property: props that transition

  • Transition-duration: time it takes, s or ms

  • Transition-timing-function: bezier curve

  • Transition delay: time until starts (good for hover if someone just moves past it)

  • Transition: shorthand for 4

Look at transform origin

Cant transition to width auto

Transforms

Seem to need to put transform class to make it work

Example

<button class="transition duration-500 ease-in-out bg-blue-500 hover:bg-red-500 transform hover:-translate-y-1 hover:scale-110">
  Hover me
</button>

Last updated