Expand description
The time axis of the make-family design system.
makeover resolves colour, makeover-geometry resolves distance, and
makeover-layout names what a thing is without resolving anything. This
crate answers the remaining question of the same shape: how long.
A duration is named by what it is waiting for, and the number follows:
| Moment | What it waits for | Resolves to |
|---|---|---|
Moment::Revert | a control returning to its resting label after confirming | 1500ms |
Moment::Clear | a status line emptying itself | 2000ms |
Moment::Dismiss | a transient notice’s lifetime | 3000ms |
Moment::Debounce | typing settling before the work starts | 150ms |
A moment resolves to exactly one duration on every renderer and under every theme; there is no per-renderer table.
§Out of scope
A race (a wait for a write to land, a delay so a mousedown beats a blur),
a severity (a message that must not be missed is not
Notice::transient, and notice_lifetime gives it no lifetime) and a
poll interval are not moments.
§Three axes
Moment is how long a state lasts, Motion how long a change takes,
and Cadence how often a repeating mark repeats.
§Reduced motion
A web surface gets a prefers-reduced-motion block in the generated
stylesheet (reduced_motion_css), which zeroes every Motion and
Cadence. Another renderer passes the MotionPreference its platform
reported to Motion::duration_for, which is zero under
MotionPreference::Reduced, and to activity_blink, or blink for
the phase, which keep the mark lit and still. Motion::duration is the
full duration under either preference. A Moment is a wait and is
unaffected.
§Consumers
Web surfaces bake timing_css in at build time. egui and ratatui surfaces
read Moment::duration and its siblings. Each value is pinned by a test.
Enums§
- Cadence
- How often a repeating mark repeats.
- Moment
- A duration named by what it is waiting for.
- Motion
- How long a change takes, as opposed to how long a state lasts.
- Motion
Preference - Whether the reader has asked for less motion, as their platform reported it.
- Persistence
- Whether a notice goes away on its own.
Functions§
- activity_
blink - How fast the activity mark blinks, given whether the reader has asked for less motion.
- blink
- Which state the activity mark is in,
elapsedinto a wait, and how long it holds that state. - notice_
lifetime - How long a notice lives, given whether it goes away on its own.
- reduced_
motion_ css - The motion-off block, for a reader who has asked for less of it.
- timing_
css - The time axis as a stylesheet, inside the family’s cascade layer.
- timing_
css_ declarations - Emit the time axis as CSS declarations, no selector.
- timing_
css_ vars - Emit the whole time axis: a
:root { ... }block, then the motion-off block (reduced_motion_css).