Skip to main content

Crate makeover_timing

Crate makeover_timing 

Source
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:

MomentWhat it waits forResolves to
Moment::Reverta control returning to its resting label after confirming1500ms
Moment::Cleara status line emptying itself2000ms
Moment::Dismissa transient notice’s lifetime3000ms
Moment::Debouncetyping settling before the work starts150ms

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.
MotionPreference
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, elapsed into 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).