дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-05 09:41:34 +02:00
Adds Reduce motion under Appearance > Accessibility. When on, or when the system asks for reduced motion, CSS animations and transitions finish at once; script-driven motion reads the same preference. Fixes #5887
10 рядки
528 B
TypeScript
10 рядки
528 B
TypeScript
/**
|
||
* Whether motion should be reduced: Settings › Appearance › Reduce motion (the `data-reduce-motion`
|
||
* root attribute) or the system's reduced-motion preference. For script-driven animation; CSS
|
||
* reads the attribute and the media query itself.
|
||
*/
|
||
export function reducedMotion(): boolean {
|
||
if (typeof document !== "undefined" && document.documentElement.dataset.reduceMotion !== undefined) return true;
|
||
return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
||
}
|