Skip to content
OAIT Design System

Design system / Foundations

Motion

Motion in the family is calm and functional. It confirms what a person did and shows where something came from or went; it never performs. State changes fade in 150ms, overlays enter with emphasis and leave faster, ambient loops live only in marketing hero art under a Pause control, and reduced motion switches everything off while every state still changes (D-SEM-13 to D-SEM-22).

Tokens: Durations, Easings, Animations, Keyframes, Opacity and state layers. Related: Elevation and borders, Accessibility, Pause control.

At a glance

  1. Calm. Short state fades; nothing lifts, scales, bounces, or glows to answer a hover or a press, and springs stay in art (D-SEM-14, D-SEM-15).
  2. Functional. Motion explains a change of state or of place: an overlay comes from somewhere and goes back, a chevron turns, a value grows. Ambient loops live only in marketing hero art (D-SEM-16, D-SEM-17).
  3. Feedback is a state layer, never movement. Hover fades in 150ms, press shows at once (D-SEM-15).
  4. Tokens only. Five durations, five easings, and ten animations; JavaScript reads its timers from the tokens (D-SEM-13, D-SEM-14, D-ARC-18).
  5. Anything that moves by itself for more than 5 seconds can be paused (WCAG 2.2.2) (D-SEM-17).
  6. Reduced motion means no motion. Every state still changes, at once (D-SEM-21).
  7. The resting state is the base style. With motion off, everything already sits where it belongs (canonical §7.4).

Durations

Token CSS Tailwind Value Use (D-SEM-13, D-ARC-18)
short-3 --duration-short-3 duration-short-3 150ms State changes (color, fill, border, and state-layer opacity on hover and release; a clickable card's shadow and edge), every fade (dialog, scrim, menu, popover, snackbar, and tooltip, in and out), and every overlay exit
short-4 --duration-short-4 duration-short-4 200ms Small moves: bottom and side sheets sliding in, chevron and plus-to-close turns, the switch thumb, the tab indicator
medium-2 --duration-medium-2 duration-medium-2 300ms Determinate progress fills; art that follows the pointer (the card-stack tilt and its glare)
extra-long-1 --duration-extra-long-1 duration-extra-long-1 700ms Expressive one-shots: the card-stack swap, the hero entrance, story fills such as a score bar; the longest a stage reveal may take
extra-long-3 --duration-extra-long-3 duration-extra-long-3 900ms The ID card flip, and nothing else
  • Five on purpose: there is no short-1, short-2, medium-1, medium-3, medium-4, long, or extra-long-2 or -4. Fewer choices, one way to do each thing (D-SEM-13).
  • 150ms is also Tailwind's default transition duration, so an unadorned Tailwind transition already matches; write duration-short-3 anyway, so the intent is visible (D-SEM-13).

Timers and loop periods

These are CSS variables only, with no Tailwind utility (the v3 preset exposes only the five durations too) (D-SEM-13, V-8).

Token CSS Value Use
delay-tooltip --duration-delay-tooltip 500ms How long a mouse rests on a control before its tooltip shows. Keyboard focus shows it at once
loop-spinner --duration-loop-spinner 1000ms One turn of a loading spinner
loop-skeleton --duration-loop-skeleton 1200ms One sweep across skeleton blocks
loop-status --duration-loop-status 2000ms The live-dot halo and the pass viewfinder breathe
loop-float --duration-loop-float 6000ms The ID-card art float, 8px up and back
loop-sheen --duration-loop-sheen 7000ms One sheen cycle: the sweep in the first 55%, then rest
loop-seal --duration-loop-seal 9000ms One turn of the holographic seal
loop-drift --duration-loop-drift 14000ms A decorative shape's drift
loop-drift-slow --duration-loop-drift-slow 18000ms The second shape's drift, played in reverse
interval-carousel --duration-interval-carousel 4200ms How long a card stays in front in an auto-advancing card stack
dwell-confirm --duration-dwell-confirm 2400ms How long an inline confirmation stays ("Address copied") before it reverts ("Copy address")
dwell-snackbar --duration-dwell-snackbar 6000ms How long a snackbar without an action stays
dwell-snackbar-action --duration-dwell-snackbar-action 10000ms How long a snackbar with an action ("Undo") stays
  • JavaScript reads timers from the tokens (or from oait.tokens.json at build time), never from literals, so products cannot drift apart again (D-SEM-13):
// Read a duration token in milliseconds: "4200ms" → 4200.
function durationMs(name) {
  return parseFloat(getComputedStyle(document.documentElement).getPropertyValue(`--duration-${name}`))
}
const every = durationMs('interval-carousel') // 4200
  • Snackbar timers wait while the snackbar is hovered or focused, and an Undo that matters also has a second path (Snackbar).

Easings

Token CSS Tailwind Value Use (D-SEM-14, D-ARC-17)
standard --ease-standard ease-standard cubic-bezier(0.4, 0, 0.2, 1) The default: state changes and small moves that stay on screen (color, state layers, the switch thumb, chevrons, the tab indicator, the glare)
emphasized --ease-emphasized ease-emphasized cubic-bezier(0.2, 0, 0, 1) Things that enter or travel: dialogs, sheets, menus, popovers, and snackbars appearing; the hero entrance; progress fills; the sheen sweep; the card-stack tilt; the live-dot halo
emphasized-accelerate --ease-emphasized-accelerate ease-emphasized-accelerate cubic-bezier(0.3, 0, 0.8, 0.15) Things that leave: dialog, sheet, menu, popover, snackbar, and tooltip exits, always over duration-short-3
spring --ease-spring ease-spring cubic-bezier(0.34, 1.56, 0.64, 1) About 10% overshoot, for art and celebration only: the card-stack swap, the ID card flip, a winner reveal on the stage. Never on interface controls
loop --ease-loop ease-loop cubic-bezier(0.42, 0, 0.58, 1) Back-and-forth loops: the float, the drift, the viewfinder breathe
linear the keyword ease-linear linear Rotations and sweeps: the spinner, the seal, the skeleton, a countdown ring. No token

The traps

  • ease-standard is cubic-bezier(0.4, 0, 0.2, 1). It is Material's original standard curve and Tailwind's default. Material 3's current "standard" curve, (0.2, 0, 0, 1), is the family's ease-emphasized; a tool that copies Material 3's web tokens writes the wrong curve under the right name (D-ARC-17).
  • Tailwind's ease-in-out utility is not the CSS keyword. The utility is (0.4, 0, 0.2, 1), the family's standard; the keyword is (0.42, 0, 0.58, 1), the family's loop. Write ease-standard or ease-loop (D-SEM-14).
  • There is no ease-out token. Two different curves are called "ease-out" today, Tailwind's (0, 0, 0.2, 1) and the keyword (0, 0, 0.58, 1); both become ease-emphasized (D-SEM-14).
  • Tailwind's own ease-in, ease-out, and ease-in-out utilities still compile in 1.0.0; never write them (canonical §4.12, D-SEM-14).
  • The spring is for art and celebration. It never moves a control (canonical §7.1).

Choosing a duration and an easing

What happens Duration Easing Examples
A color, fill, border, or state layer changes duration-short-3 ease-standard hover and release on a button, row, chip, or card
Something appears by fading duration-short-3 ease-emphasized; the scrim and the plain tooltip fade in with ease-standard a dialog, menu, popover, or snackbar coming in
Something leaves duration-short-3 ease-emphasized-accelerate every overlay exit
A sheet slides in duration-short-4 ease-emphasized bottom sheet, side sheet
A small part turns or slides in place duration-short-4 ease-standard chevron, plus-to-close, switch thumb, tab indicator
A value grows duration-medium-2 ease-emphasized determinate progress
Art follows the pointer duration-medium-2 ease-emphasized for the tilt, ease-standard for the glare the card stack
An expressive one-shot duration-extra-long-1 ease-emphasized; ease-spring for the stack swap the hero entrance, a story fill, the card-stack swap
The ID card turns over duration-extra-long-3 ease-spring the My ID flip
A loop its --duration-loop-* token ease-loop back and forth; linear for rotations and sweeps; ease-emphasized for the sheen and the live halo float, drift, breathe; spinner, seal, skeleton; sheen, live dot

Feedback

  • Every interactive surface shows hover and press with a state layer: a ::before of currentColor at --opacity-state-hover (0.08) and --opacity-state-pressed (0.12), and --opacity-state-dragged (0.16) while dragged. There is no focus layer; the ring shows focus (Color, D-COL-05, D-ARC-02).
  • Hover and release fade over duration-short-3 with ease-standard. Hover applies only under @media (hover: hover), so a touch screen never keeps a stuck hover. Press shows at once (0ms), so even a quick tap shows it (D-SEM-15).
/* The state layer's timing. The rest of the layer (position, inset, currentColor, radius) is in Color. */
.oa-btn::before {
  opacity: var(--oa-state, 0);
  transition: opacity var(--duration-short-3) var(--ease-standard);
}
@media (hover: hover) {
  .oa-btn:hover { --oa-state: var(--opacity-state-hover); }
}
.oa-btn:active { --oa-state: var(--opacity-state-pressed); }
.oa-btn:active::before {
  transition-duration: 0ms; /* lint-ok: press shows at once; release fades */
}
  • Tailwind: before:transition-opacity before:duration-short-3 before:ease-standard active:before:duration-0. Tailwind v4's hover variant already applies only under (hover: hover).
  • Where a pseudo-element cannot be used (shadcn class strings), the hover mixes into the fill instead, with the same timing: hover:bg-[color-mix(in_srgb,var(--color-on-primary)_8%,var(--color-primary))] transition-colors duration-short-3 ease-standard (D-ARC-03).
  • A clickable card: under a hovering mouse it takes shadow-elevation-3 and its edge turns outline, over duration-short-3 with ease-standard; pressed shows the 12% layer. The card never moves: a lift moves the stretched title link out from under the pointer, so a pointer near the bottom edge falls off and the card flickers (D-SEM-15, D-ARC-16). Tailwind: hover:shadow-elevation-3 hover:border-outline transition-[box-shadow,border-color] duration-short-3 ease-standard.
  • An inline confirmation swaps at once: "Copy address" becomes "Address copied" with a check icon, in a polite live region, and reverts after --duration-dwell-confirm (canonical §10.9).
  • The focus ring never transitions (Elevation and borders).
  • Never: hover lifts, press scaling, shadows on controls, brightness filters, ripples, pointer glows, icon wiggles, or arrow nudges. Trailing arrows never move (D-SEM-15, C-1).

Component recipes

Overlays

Component Enter Exit (D-SEM-16)
Scrim opacity 0 → 1, duration-short-3, ease-standard opacity → 0, duration-short-3, ease-emphasized-accelerate
Dialog opacity 0 → 1 and transform: scale(0.95) → none, duration-short-3, ease-emphasized opacity → 0 and back to 0.95, duration-short-3, ease-emphasized-accelerate
Bottom sheet transform: translateY(100%) → none, duration-short-4, ease-emphasized back to 100%, duration-short-3, ease-emphasized-accelerate
Side sheet a 100% slide from its attached edge (mirrored in Arabic), duration-short-4, ease-emphasized back to its edge, duration-short-3, ease-emphasized-accelerate
Menu, popover, listbox opacity 0 → 1 and transform: translateY(4px) → none, duration-short-3, ease-emphasized opacity → 0, duration-short-3, ease-emphasized-accelerate
Snackbar, toast opacity 0 → 1, duration-short-3, ease-emphasized opacity → 0, duration-short-3, ease-emphasized-accelerate
Plain tooltip after --duration-delay-tooltip of mouse rest (at once on keyboard focus): opacity, duration-short-3, ease-standard opacity, duration-short-3, ease-emphasized-accelerate
  • Overlays enter with ease-emphasized (the scrim and the tooltip with ease-standard) and leave faster with ease-emphasized-accelerate, the Material 3 pattern; the values (150ms fades, the 0.95 scale, 200ms sheets) are the ones Jobs ships and shadcn emits (D-SEM-16).
  • 1.0.0 has no exit animation token: the exits above run as CSS transitions (opacity, and the sheets' slide) over duration-short-3 with ease-emphasized-accelerate, and React (Radix) products may let an overlay leave at once instead. An animate-fade-out token is requested for 1.1 (D-SEM-16; Changelog).
  • The reference CSS moves overlays with the individual scale and translate properties and starts them from @starting-style, so a native <dialog> animates in and out (Dialog).
  • Never wait for transitionend or animationend to move focus or change state: under reduced motion those events never fire (D-SEM-21).
  • See Dialog, Bottom sheet, Side sheet, Menu, Tooltip, and Snackbar.

Small moves

Component Change Duration Easing
Disclosure, accordion the expand_more chevron turns 180° (it does not mirror); the panel never animates its height duration-short-4 ease-standard
Plus-to-close, menu-to-close icons turn 45° or morph duration-short-4 ease-standard
Switch thumb slides to the other end; it jumps under reduced motion (C-10) duration-short-4 ease-standard
Tab indicator moves and resizes to the selected tab; where each tab draws its own indicator, as the reference CSS does, its color changes in place over the same timing duration-short-4 ease-standard
Determinate progress the indicator's width grows from the inline start duration-medium-2 ease-emphasized
Story fill (a score bar, a result reveal) width duration-extra-long-1 ease-emphasized
Countdown ring (the pass) the ring's stroke dash offset, one step a second one second per tick, a component constant linear
Inline confirmation the label and icon swap, and revert after --duration-dwell-confirm instant none

Decisions: D-SEM-16, C-10, D-CSN-16, D-CSN-31, D-CSN-44.

Entrances and transitions

  • One entrance per marketing page, on the hero only, once: animate-rise (the hero rises 16px and fades in over duration-extra-long-1 with ease-emphasized). Functional screens have no entrance (D-SEM-19).
  • No page or view transitions, and no parallax (D-SEM-19).
  • Scroll reveals retire. Content is always visible: hidden-until-scrolled content was missed by the audit's own census (13 oait cards were invisible when measured), by find-in-page, and by screenshots (D-SEM-19).

Animations and keyframes

Animation CSS Tailwind Value Where it may run (canonical §7.4, D-ARC-18)
rise --animate-rise animate-rise oa-rise var(--duration-extra-long-1) var(--ease-emphasized) The hero entrance: once, on the hero of a marketing page
float --animate-float animate-float oa-float var(--duration-loop-float) var(--ease-loop) infinite ID-card art in marketing hero art, under a Pause control
drift --animate-drift animate-drift oa-drift var(--duration-loop-drift) var(--ease-loop) infinite The first decorative shape behind hero art, under the Pause control
drift-slow --animate-drift-slow animate-drift-slow oa-drift var(--duration-loop-drift-slow) var(--ease-loop) infinite reverse The second shape, slower and reversed, so the two never move in step
sheen --animate-sheen animate-sheen oa-sheen var(--duration-loop-sheen) var(--ease-emphasized) infinite The band of light across the front ID card in hero art; one iteration only on functional screens
seal --animate-seal animate-seal oa-spin var(--duration-loop-seal) linear infinite The holographic seal, in hero art only
spinner --animate-spinner animate-spinner oa-spin var(--duration-loop-spinner) linear infinite A loading spinner, only while loading and always with words
live --animate-live animate-live oa-live var(--duration-loop-status) var(--ease-emphasized) infinite The halo of a live status dot, in the dot's own color, only while live and always with its word
breathe --animate-breathe animate-breathe oa-breathe var(--duration-loop-status) var(--ease-loop) infinite The pass viewfinder corners while the pass is ready to scan
skeleton --animate-skeleton animate-skeleton oa-skeleton var(--duration-loop-skeleton) linear infinite The sweep across skeleton blocks, only while loading

The keyframes ship in oait.css and tailwind.css:

@keyframes oa-rise {        /* the hero entrance; only a start, so the resting style is the end */
  from { opacity: 0; transform: translateY(16px); }
}
@keyframes oa-float {       /* card-art float, 8px */
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes oa-drift {       /* decorative shapes */
  0%, 100% { transform: translate(0) rotate(0); }
  50% { transform: translate(12px, -14px) rotate(6deg); }
}
@keyframes oa-sheen {       /* a band of light crosses once, then rests off the card */
  0% { background-position: 160% 0; }
  55%, 100% { background-position: -60% 0; }
}
@keyframes oa-spin {        /* the seal and the spinner */
  to { transform: rotate(360deg); }
}
@keyframes oa-live {        /* the live-dot halo, in the dot's own color */
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 75%, transparent); }
  70% { box-shadow: 0 0 0 9px color-mix(in srgb, currentColor 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 0%, transparent); }
}
@keyframes oa-breathe {     /* the viewfinder corners */
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
@keyframes oa-skeleton {    /* the skeleton sweep; the element has background-size: 220% 100% */
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}
  • The base style is always the resting state, because with motion off every element shows it: the sheen layer rests off the card (background-position: -60% 0), the hero is written where it sits (oa-rise has only a start), the viewfinder corners and the live dot are fully visible and still, and a skeleton is a flat bg-skeleton block (canonical §7.4).
  • On functional screens the sheen runs once: animate-sheen [animation-iteration-count:1] (CSS animation: var(--animate-sheen); animation-iteration-count: 1;).
  • The skeleton sweep runs on its gradient: background: linear-gradient(90deg, var(--color-skeleton), var(--color-skeleton-highlight), var(--color-skeleton)); background-size: 220% 100%; with animate-skeleton. Draw the gradient only inside @media (prefers-reduced-motion: no-preference), so that with motion off the block is a flat bg-skeleton fill (Skeleton).
  • The live halo is drawn in currentColor, so the dot's color sets it (Status indicator).
  • Retired names: gu-sheen, gu-spin, gu-float, gu-float-stack, drift, gu-rise, gu-pulse, gu-breathe, and ping become the oa-* keyframes above. Tailwind's animate-spin, animate-pulse, animate-ping, and animate-bounce still compile; write animate-spinner and animate-skeleton instead (D-ARC-18, canonical §4.12).

Ambient motion and the Pause control

Kind Examples Where Rule (D-SEM-17)
Ambient loops float, sheen, seal, drift marketing hero art only inside a region with a Pause control; never on functional screens
Auto-advance the card stack marketing hero art every --duration-interval-carousel; waits while the pointer is over the region or focus is inside it; stops for good once the person picks an item; stops with the Pause control; never under reduced motion, nor before the browser has said whether motion is reduced
Status loops the live-dot halo, the viewfinder breathe, the skeleton sweep, the spinner, a scanning line any screen only while the state lasts, and always with words: "Ready to scan", "Getting your scan code…", "Loading people…"
One-shots the hero entrance, the flip, the stack swap, a celebration as their recipes finish within 5 seconds
  • WCAG 2.2.2 (Pause, Stop, Hide): anything that starts by itself and moves, blinks, or auto-advances for more than 5 seconds needs a visible way to pause it. Pausing on hover and the reduced-motion setting are not mechanisms every person can find (D-SEM-17).

The Pause control (contract; the component page has the reference markup):

Part Spec (D-SEM-17, C-4, D-CAI-07)
Element <button type="button" aria-controls="hero-art">: the outlined icon button, a 48px circle (size-12 rounded-full) with a 24px on-surface-variant icon, a border-outline-variant hairline, and an opaque surface-container-lowest fill, so the glyph stays readable over moving art. Not a toggle: no aria-pressed, because the name says what a press does. Reference class: .oa-pause (marketing.css)
Name and icon "Pause animation" with pause while things move; "Play animation" with play_arrow while paused. Media icons never mirror in Arabic
Arabic and French through native review (C-4). oait's shipped Arabic label, إيقاف تبديل التطبيقات مؤقتًا, names the old "Pause app rotation" and changes with it
Tooltip the plain tooltip with the same words, like every icon button
Placement inside the region it controls, in reading order with the art's other controls, visible at every width
Effect sets [data-motion="paused"] on the region, which pauses every animation inside it (base.css); stops the auto-advance; the choice holds for the rest of the visit
Reduced motion hidden, because nothing moves (motion-reduce:hidden)

The pause rule ships in reference/css/base.css:

[data-motion="paused"] *,
[data-motion="paused"] ::before,
[data-motion="paused"] ::after {
  animation-play-state: paused !important; /* lint-ok: the Pause control must beat every component animation (D-SEM-17) */
}

A sketch of the script for one region with an auto-advancing stack (durationMs is the helper above; showNextCard is the stack's own):

const region = document.getElementById('hero-art')
const pause = region.querySelector('button[aria-controls="hero-art"]')
const glyph = pause.querySelector('.oa-icon')
const lessMotion = window.matchMedia('(prefers-reduced-motion: reduce)')
let paused = false // the person pressed Pause; keep it for the rest of the visit
let picked = false // the person chose a card: auto-advance stops for good
// The pointer and the focus are tracked apart, so a mouse that passes over the region
// never restarts the timer under someone whose focus is inside it.
let pointerInside = false
let focusInside = false
let timer = 0

function render() {
  if (paused) region.setAttribute('data-motion', 'paused')
  else region.removeAttribute('data-motion')
  // Names in the page language; update the tooltip with the same words.
  pause.setAttribute('aria-label', paused ? 'Play animation' : 'Pause animation')
  glyph.textContent = paused ? 'play_arrow' : 'pause'
}
function schedule() {
  clearInterval(timer)
  if (paused || pointerInside || focusInside || picked || lessMotion.matches) return
  timer = setInterval(showNextCard, durationMs('interval-carousel'))
}
pause.addEventListener('click', () => { paused = !paused; render(); schedule() })
region.addEventListener('pointerenter', () => { pointerInside = true; schedule() })
region.addEventListener('pointerleave', () => { pointerInside = false; schedule() })
region.addEventListener('focusin', () => { focusInside = true; schedule() })
region.addEventListener('focusout', (event) => {
  if (!region.contains(event.relatedTarget)) { focusInside = false; schedule() }
})
lessMotion.addEventListener('change', schedule)
render()
schedule()
// The stack's own pick handler sets picked = true and calls schedule().
  • Product note (Global ID): the landing hero loops and auto-advances with no Pause control today, which fails WCAG 2.2.2 in production. It is the first fix of the rollout (ID-1.01).

Signature art motion

The card stack

The family's most ownable motion, on oait's hero and Global ID's landing, kept exactly as the client asked for it (ruling R166), with tokenized curves (D-SEM-20).

Place after the front card Transform Opacity Local z-index
Front translate3d(0, 0, 60px) rotate(0) scale(1) 1 3
Next translate3d(9%, 7%, 0) rotate(7deg) scale(0.94) 1 2
Previous translate3d(-9%, -8%, 0) rotate(-7deg) scale(0.92) 1 2
Others translate3d(0, -4%, -40px) rotate(0) scale(0.86) 0 1
  • In Arabic the x offsets and the rotations are multiplied by −1, so the fan mirrors: next becomes translate3d(-9%, 7%, 0) rotate(-7deg) scale(0.94) (D-SEM-20).
  • The layers move with transition: transform var(--duration-extra-long-1) var(--ease-spring), opacity var(--duration-extra-long-1) var(--ease-spring); (Tailwind transition-[transform,opacity] duration-extra-long-1 ease-spring).
  • The z-index values are local, 1–3 as canonical §4.9 asks of a component that stacks its own children: the stack's own perspective transform makes it a stacking context, so they never compete with the page's layers. Today's 30, 20, and 10 move to 3, 2, and 1. Never put isolation: isolate on the element that keeps transform-style: preserve-3d, because isolation flattens the 3D scene; set it on a wrapper if one is needed (Layout).
  • The stack advances every --duration-interval-carousel, with the pause and stop rules above.
  • Tilt, for a mouse only (event.pointerType === 'mouse'), never for touch and never under reduced motion: with a and r the pointer's position across and down the stack's box minus 0.5, turn the stack 16·a degrees around Y and −12·r degrees around X (so at most ±8° and ±6°), as transform: perspective(1100px) rotateX(…) rotateY(…) with transition: transform var(--duration-medium-2) var(--ease-emphasized);, and return both to 0 when the pointer leaves.
  • The glare follows the pointer and fades with transition: opacity var(--duration-medium-2) var(--ease-standard);.
  • The stack floats 8px (animate-float), the front card shines (animate-sheen), the seal turns (animate-seal), and two shapes drift (animate-drift, animate-drift-slow), all under the hero's Pause control.
  • The cards are illustration, hidden from assistive technology, with one visually hidden sentence that says what they show; the chips under the stack are the controls (Passport card).

The ID card flip

Part Spec (D-SEM-20, canonical §7.6)
Wrapper perspective: 1600px; (Tailwind perspective-[1600px])
Card transform-style: preserve-3d; (transform-3d); both faces backface-visibility: hidden; (backface-hidden); the back face turned with transform: rotateY(180deg) in advance
Flip the card turns with transform: rotateY(180deg) and transition: transform var(--duration-extra-long-3) var(--ease-spring); (Tailwind transition-transform duration-extra-long-3 ease-spring)
Control a button laid over the card, not its parent, named for the side it would show
Screen readers the side is state, so the new face is read at once, with or without motion; the face that does not show is hidden from assistive technology
Reduced motion the faces swap at once
Language The flip button's name (Global ID's messages)
English Show the Arabic side · Show the English side
Arabic عرض الوجه العربي · عرض الوجه الإنجليزي
French Afficher la face arabe · Afficher la face anglaise
  • To run the sheen again after a flip, restart its one iteration (for example by re-creating the sheen layer). See ID card.

Reduced motion

The kill switch ships in reference/css/base.css (canonical §7.7):

@layer base {
  @media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
      animation: none !important;
      transition: none !important;
      scroll-behavior: auto !important;
    }
  }
}
@layer base {
  @media (prefers-reduced-motion: reduce) {
    ::backdrop {
      animation: none !important;
      transition: none !important;
    }
  }
}
@layer base {
  @media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
      animation: none !important;
    }
  }
}
  • The rule sits in the base layer with !important, so it wins over every later layer and over style attributes: Global ID's version, the only one proven to beat inline styles. The ::backdrop and view-transition selectors sit in rules of their own, because one unknown pseudo-element in a selector list drops the whole rule in older engines (D-SEM-21).
  • It makes Tailwind's motion-safe gating (such as motion-safe:transition-colors) redundant; do not add it (D-SEM-21).

JavaScript contract (D-SEM-21):

  • Check matchMedia('(prefers-reduced-motion: reduce)'), listen for its change event, and assume "reduce" until the browser answers: on the server, render the still version first.
  • Under reduce: no auto-advance timers, no tilt, no Web Animations (element.animate()), no smooth scrolling (scrollIntoView({ behavior: 'auto' })), no autoplaying video, Lottie, or animated images (show a still), no SMIL.
  • Never wait for transitionend or animationend to change state: the kill switch removes those events.

React (Global ID's pattern):

import { useSyncExternalStore } from 'react'

const LESS_MOTION = '(prefers-reduced-motion: reduce)'

function subscribe(onChange: () => void) {
  const query = window.matchMedia(LESS_MOTION)
  query.addEventListener('change', onChange)
  return () => query.removeEventListener('change', onChange)
}

/** True when the person asks for less motion. On the server it is true, so nothing moves before the browser has said. */
export function useLessMotion() {
  return useSyncExternalStore(subscribe, () => window.matchMedia(LESS_MOTION).matches, () => true)
}

What still happens under reduced motion (D-SEM-21, canonical §7.7):

Part Under reduced motion
Every state changes at once: color, fill, border, the focus ring, content, and an overlay appearing or going
Hover and press the state layer still shows, without the fade
Overlays appear and disappear at once; focus moves as usual
Switch the thumb jumps (C-10)
Spinner stands still beside its words
Live dot keeps a still halo and its word
Pass countdown shows its number
Skeleton a flat bg-skeleton block
Sheen rests off the card
Hero is shown where it sits
ID card flip the faces swap at once
Ambient loops and auto-advance do not run, and the Pause control is hidden
Celebration particles hidden
Scrolling jumps; no smooth scrolling

The stage

  • Celebration motion (reveals, confetti, the winner) runs only on the Games projector stage. It is one-shot and finishes within 5 seconds; it never flashes more than three times in any one second (WCAG 2.3.1); it uses ease-spring or ease-emphasized; each staggered reveal takes duration-extra-long-1 (700ms) or less; confetti and particles are hidden under reduced motion (D-SEM-22, canonical §7.8 and §11).
  • The public screen has no controls; the host works on a separate private screen (Large-display stage, Stage).
  • Migration (Global Games): the podium reveals of 1s, 1s, and 1.3s, ending at 4.1s, shorten to 700ms or less each; the 4-second confetti is hidden under reduced motion; easings move to the tokens (D-SEM-22, GG-2.18).

Never

  • Hover lifts, press scaling, shadows on controls, brightness filters, ripples, pointer glows, icon wiggles, arrow nudges (D-SEM-15, C-1).
  • Scroll reveals (unless the client keeps oait's), parallax, page or view transitions, text or underline drawing animations (D-SEM-19).
  • A spring on an interface control (D-SEM-14).
  • Loops on functional screens; status loops while their state lasts are the exception (D-SEM-17).
  • An animated focus ring (D-SEM-11).
  • An animated panel height in an accordion or disclosure (D-SEM-16).
  • Literal durations or curves in code, including JavaScript timers (D-SEM-13). The pass countdown's one-second tick is a clock, not a motion duration, and stays a component constant.
  • Motion without the reduced-motion kill switch and the JavaScript check (D-SEM-21).

Code

Plain CSS

  • A transition names the properties it moves, a duration token, and an easing token (the reference CSS never transitions all properties); an animation uses its shorthand token:
.oa-progress__indicator {
  transition: inline-size var(--duration-medium-2) var(--ease-emphasized);
}
.oa-spinner {
  animation: var(--animate-spinner);
}

Tailwind CSS v4

Need Classes
State-layer timing before:transition-opacity before:duration-short-3 before:ease-standard active:before:duration-0
Clickable card hover hover:shadow-elevation-3 hover:border-outline transition-[box-shadow,border-color] duration-short-3 ease-standard
Chevron in a details row Tailwind's group class on the <details>; on the icon transition-transform duration-short-4 ease-standard group-open:rotate-180
Determinate progress transition-[width] duration-medium-2 ease-emphasized
Card-stack layer transition-[transform,opacity] duration-extra-long-1 ease-spring
Card-stack tilt transition-transform duration-medium-2 ease-emphasized
ID card flip wrapper perspective-[1600px]; card transform-3d transition-transform duration-extra-long-3 ease-spring; faces backface-hidden
Countdown ring transition-[stroke-dashoffset] duration-1000 ease-linear
Hero entrance animate-rise
Sheen once animate-sheen [animation-iteration-count:1]
Spinner, skeleton, live dot, viewfinder animate-spinner, animate-skeleton, animate-live, animate-breathe
Pause control motion-reduce:hidden

Tailwind CSS v3

  • tailwind.preset.cjs exposes the five durations through transitionDuration, the five easings through transitionTimingFunction, and the ten animations through animation; load it with oait.css, which holds the keyframes (V-8).

shadcn/ui

  • Keep shadcn's enter and exit animation classes on Dialog, Sheet, Popover, and DropdownMenu, and time them with the tokens: data-[state=open]:duration-short-3 data-[state=open]:ease-emphasized data-[state=closed]:duration-short-3 data-[state=closed]:ease-emphasized-accelerate. A Sheet enters with data-[state=open]:duration-short-4 and slides the full 100%, not 10% (D-SEM-16, D-SEM-23).
  • Sonner: a 150ms fade, the snackbar dwell times (6000ms, 10000ms with an action), and one toast at a time (Snackbar).
  • Skeleton: replace its pulse with the sweep (animate-skeleton on the skeleton gradient) (V-7).
  • Accordion: drop the height animation; only the chevron turns (D-CSN-31).

Do and don't

Do Don't
Fade the hover layer over duration-short-3 lift, scale, or brighten a button on hover
Show the press at once fade the press in
ease-emphasized in and ease-emphasized-accelerate out one curve both ways, or ease-spring on a dialog
Turn the chevron and show the panel at once animate an accordion's height
A 48px Pause control in a region that moves by itself for more than 5 seconds rely on hover to pause, or loop on a functional screen
Read --duration-interval-carousel in JavaScript write 4200 in code
Change the state first and let the motion follow wait for transitionend before moving focus
One animate-rise on the hero scroll reveals or page transitions