function prefersReducedMotion
prefersReducedMotion(): boolean

Checks if the user prefers reduced motion based on their system settings. Important for accessibility - animations should be disabled when this returns true.

Examples

Example 1

import { prefersReducedMotion } from "hibana/utils/dom_utils.ts";

if (!prefersReducedMotion()) {
  element.classList.add('animate-fade-in');
}

Return Type

boolean

True if user prefers reduced motion

Usage

import { prefersReducedMotion } from ".";