use-motion-preference 0.0.1

Primitive reduced-motion preference helpers
Documentation
  • Coverage
  • 8.33%
    1 out of 12 items documented1 out of 7 items with examples
  • Size
  • Source code size: 4.92 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 382.53 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 38s Average build duration of successful builds.
  • all releases: 38s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-accessibility
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

Primitive reduced-motion preference helpers.

These helpers keep policy decisions explicit and deterministic.

Examples

use use_motion_preference::{
    AnimationPolicy, MotionPreference, adjust_duration_ms, animation_policy,
    should_disable_animation, should_reduce_motion,
};

assert_eq!(
    animation_policy(MotionPreference::Reduce, false),
    AnimationPolicy::Disable
);
assert_eq!(
    animation_policy(MotionPreference::Reduce, true),
    AnimationPolicy::Reduce
);
assert!(should_reduce_motion(MotionPreference::Reduce));
assert!(should_disable_animation(MotionPreference::Reduce, false));
assert_eq!(adjust_duration_ms(400, MotionPreference::Reduce), 200);