Skip to contentWolf-Rayet

Motion

Motion shows what changed, where it came from, and where it went. In Wolf-Rayet it also costs attention, so how much something may move depends on how much it is allowed to ask for.

Principles

Purposeful. Motion explains a change. If removing it would not lose the reader anything, remove it.

Rationed. Movement draws the eye, so it is budgeted like colour. Each attention level has a longest duration it may use, and only a demand may keep moving.

Accessible. When a reader asks for reduced motion, every change shortens to 110ms and repeating motion slows or stops. Nothing flashes, and nothing sweeps across the screen.

Fast. Nothing waits for an animation to finish. Exits are quicker than entrances, so a dismissed thing never stands in the way.

Duration

How long a change takes. Short for things people do often, longer for things that are rarer and larger.

duration-0
80ms
duration-1
110ms
duration-2
155ms
duration-3
220ms
duration-4
305ms
TokenValueUse for
--wr-duration-080msHover and press feedback that happens many times a minute.
--wr-duration-1110msSmall entrances and exits. The ambient grant.
--wr-duration-2155msPopups, menus and state changes that should be noticed.
--wr-duration-3220msDrawers and larger surfaces arriving on screen.
--wr-duration-4305msThe longest a single change may take. Reserved for a demand.
--wr-duration-5430msLonger than any level is granted. Not used by components.

Easing

How a change speeds up and slows down. Choose the curve by what the element is doing.

easing-enter
Things arriving. Fast start, soft landing.
easing-exit
Things leaving. Slow start, then out of the way.
easing-standard
Things that change in place, like a colour or a size.
easing-emphasized
A demand arriving. Used sparingly.
easing-linear
Loops, like a spinner, where no moment matters more than another.
TokenCurveUse for
--wr-easing-entercubic-bezier(0, 0, 0.2, 1)Things arriving. Fast start, soft landing.
--wr-easing-exitcubic-bezier(0.4, 0, 1, 1)Things leaving. Slow start, then out of the way.
--wr-easing-standardcubic-bezier(0.2, 0, 0, 1)Things that change in place, like a colour or a size.
--wr-easing-emphasizedcubic-bezier(0.05, 0.7, 0.1, 1)A demand arriving. Used sparingly.
--wr-easing-linearcubic-bezier(0, 0, 1, 1)Loops, like a spinner, where no moment matters more than another.

Properties

What changes. Pick one, or two at most.

Fade
Opacity only. For things that appear in place.
Slide
A short move from where it belongs.
Scale
Grows from 95%. For things that belong to the whole view.
Color
A change of state, with nothing moving.

Motion by attention level

The longest duration each level may use, and what it may do. A component declares its level, and its motion comes from that grant.

LevelMayLongest
0 · SubstrateNothing. The page itself does not move.0ms
1 · AmbientEnter and exit.110ms
2 · MarkedEnter, exit, and change state.155ms
3 · DirectedAlso arrive, which means travel to draw the eye.220ms
4 · DemandedAlso keep moving until it is answered.305ms

A spinner or a loading bar repeats because work is still running, not because it wants attention. Loops use the period tokens, --wr-period-0 to --wr-period-4, and never repeat faster than once every 800ms. Under reduced motion they slow to once every 3 seconds or stop.

Component tokens

Every component with a token record has its own motion tokens. Use these before anything else.

TokenWhat it is
--wr-<component>-transition-durationThe longest duration the component's level grants it.
--wr-<component>-transition-easingThe curve its record gives it.
--wr-<component>-sustained-durationOnly on components that may keep moving while they demand attention.

A build check reads every stylesheet: a component with a record must move by its own tokens, and no stylesheet may write a raw duration or curve.

Best practices

Do

Keep motion for things people do often under 150ms, and let rarer, larger moments take longer.

Don't

Don't make someone wait for an animation before they can do the next thing.

Do

Let one thing lead. When several things change at once, animate the one that matters and let the rest appear.

Don't

Don't run several animations at the same moment. They pull the eye in different directions.

Accessibility

Reduced motion is handled by the tokens, not by each component. When the setting is on, every level's grant becomes 110ms and loops slow down, so a component that uses its own tokens is covered without writing anything. Check every screen with the setting on, and make sure it still works with no motion at all.

Next