AI CSS Animations

Back Out Down

Steps back first, shrinking to 75 percent and dimming, then drops away and fades. The drop uses an ease-in back curve, so it lifts a hair before it falls, like something let go.

Also known as: backOutDown, back out down css, shrink then drop exit.

Back

HTML

<div class="kfa-back-out-down">Back</div>

CSS

.kfa-back-out-down {
  --c: var(--kfa-color, #3b82f6);
  font-size: var(--kfa-size, 16px);
  display: grid;
  place-items: center;
  width: 5.5em;
  height: 5.5em;
  border-radius: 1em;
  background: var(--c);
  color: #fff;
  font-family: system-ui, sans-serif;
  font-weight: 700;
  box-shadow: 0 0.6em 1.4em -0.6em color-mix(in srgb, var(--c) 70%, transparent);
  animation: kfa-back-out-down-kf 0.95s both;
}
@keyframes kfa-back-out-down-kf {
  0% { transform: none; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
  25% { opacity: 0.8; transform: scale(0.75); animation-timing-function: cubic-bezier(0.6, -0.28, 0.74, 0.05); }
  100% { opacity: 0; transform: translateY(2.4em) scale(0.75); }
}

@media (prefers-reduced-motion: reduce) {
  .kfa-back-out-down, .kfa-back-out-down *, .kfa-back-out-down::before, .kfa-back-out-down::after, .kfa-back-out-down *::before, .kfa-back-out-down *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

Customizing this snippet

  • Color: set --kfa-color on the element or a parent. Currently previewing #3b82f6.
  • Base size: set --kfa-size. Every other dimension is in em, so the whole thing scales together. Currently previewing 16px.
  • Speed: change the duration on the transition or animation shorthand. Staggered delays are relative, so they keep their rhythm.
  • Reduced motion: the rule at the end of the CSS turns the motion off for people who asked their OS for less of it. Keep it.

Similar keyframe animations