Skip to content

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-instant100msmicro-feedback: transform, option hover
ts duration-fast150msstandard: color, opacity, shadow, focus, popovers
ts duration-base200mstheme change, overlay exit
ts duration-slow300mslayout (width), Modal and Drawer entrance
ts duration-slower500msCard hover effects
Token Value Use
--ts-duration-spin600msSpinner rotation
--ts-duration-loop-fast1200msindeterminate Progress, dots
--ts-duration-loop-base1600msSkeleton, Badge pulse
--ts-duration-loop-slow4000msCard ambilight
Token Value Use
ts ease-standardeasestate changes
ts ease-incubic-bezier(0.4, 0, 1, 1)exits
ts ease-outcubic-bezier(0.22, 1, 0.36, 1)entrances
ts ease-springcubic-bezier(0.16, 1.3, 0.3, 1)bounce (Switch, Checkbox)
ts ease-in-outease-in-outloops
ts ease-linearlinearcontinuous 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.