@stihl-design-system/components
Version:
Welcome to the STIHL Design System react component library.
15 lines (14 loc) • 645 B
TypeScript
/**
* Determines whether animations should be disabled based on user preferences
* and the current DS CSS custom property for animation duration.
*
* This function checks two main conditions:
* 1. If the user has enabled the "reduce motion" setting in their browser.
* 2. If the CSS variable `--ds-animation-duration` is set to `'0s'` or `'0ms'`.
*
* If the window object is not available (e.g., during server-side rendering),
* the function will assume that animations should be disabled.
*
* @returns {boolean} `true` if animations should be disabled, `false` otherwise.
*/
export declare const isAnimationDisabled: () => boolean;