Motion
Animation durations live in one place and respect prefers-reduced-motion without the components
having to do anything.
CSS tokens
Every CSS transition and animation (the transition-* utilities,
the reset, and the components) reads these tokens. There are no
stray durations or curves. You override them from the theme with the motion key (durations, loops, iterations, easings)
and use them with duration-* and ease-* (or var(--ts-duration-fast)).
| Token | Value | Use |
|---|---|---|
ts duration-instant | 100ms | micro-feedback: transform, option hover |
ts duration-fast | 150ms | standard: color, opacity, shadow, focus, popovers |
ts duration-base | 200ms | theme change, overlay exit |
ts duration-slow | 300ms | layout (width), Modal and Drawer entrance |
ts duration-slower | 500ms | Card hover effects |
| Token | Value | Use |
|---|---|---|
--ts-duration-spin | 600ms | Spinner rotation |
--ts-duration-loop-fast | 1200ms | indeterminate Progress, dots |
--ts-duration-loop-base | 1600ms | Skeleton, Badge pulse |
--ts-duration-loop-slow | 4000ms | Card ambilight |
| Token | Value | Use |
|---|---|---|
ts ease-standard | ease | state changes |
ts ease-in | cubic-bezier(0.4, 0, 1, 1) | exits |
ts ease-out | cubic-bezier(0.22, 1, 0.36, 1) | entrances |
ts ease-spring | cubic-bezier(0.16, 1.3, 0.3, 1) | bounce (Switch, Checkbox) |
ts ease-in-out | ease-in-out | loops |
ts ease-linear | linear | continuous rotation |
Reduced motion, handled once
With prefers-reduced-motion: reduce, the transition duration
tokens (instant through slower) are set to 1ms. The final state is reached on the first frame, and transitionend events still fire (with 0s they wouldn’t). Loops aren’t shortened—a ~0ms loop would be a strobe light.
Looping animations that cover a large area, the Skeleton shimmer, the indeterminate Progress
bar, and the pulsing Badge halo, stand still: --ts-iterations-loop goes from infinite to 0, and each one shows a fixed
state that still reads as “loading” (the Skeleton with a soft tone in the middle, the bar as a
fixed stretch of the track, the Badge as its dot without the halo). The Spinner, the loading dots, and the circular Progress spin keep
turning: they’re the signal that something is happening.