Skip to main content

activity_blink

Function activity_blink 

Source
pub const fn activity_blink(preference: MotionPreference) -> Option<Duration>
Expand description

How fast the activity mark blinks, given whether the reader has asked for less motion.

The caller supplies the preference its platform reported.

assert_eq!(
    activity_blink(MotionPreference::Full),
    Some(Cadence::Activity.duration())
);
assert_eq!(activity_blink(MotionPreference::Reduced), None);

None means the mark does not blink: it is drawn, lit and still for as long as the wait lasts. It does not mean “the caller decides” or “draw nothing”.

A web surface does not call this: the prefers-reduced-motion block in reduced_motion_css does the same in the cascade.