Browse documentation

Reference / Transitions & animation

Animation composition

Control how animated values combine with the element’s underlying property value. Replace is the CSS default.

Working example

In this sample add combines the resting tilt and the animated rotation. With replace, the keyframes supply the entire transform while the animation runs.

HTML
<details class="group rounded border p-4">
  <summary class="cursor-pointer font-semibold">Inspect the angled label</summary>
  <p class="mt-3 origin-left rotate-3 motion-safe:group-open:animate-wiggle motion-safe:group-open:animate-composition-add">Edition 01</p>
</details>

Class reference

ClassCSS declarations
animate-composition-replaceanimation-composition: replace;
animate-composition-addanimation-composition: add;
animate-composition-accumulateanimation-composition: accumulate;
View full generated CSS
Compiled CSS
.animate-composition-accumulate {
  animation-composition: accumulate;
}
.animate-composition-add {
  animation-composition: add;
}
.animate-composition-replace {
  animation-composition: replace;
}