add isReducedMotion util (#333)
This commit is contained in:
@ -26,3 +26,12 @@ export function updateCursors(
|
||||
setCursor(newSelections)
|
||||
}
|
||||
}
|
||||
|
||||
export function isReducedMotion(): boolean {
|
||||
return (
|
||||
typeof window !== 'undefined' &&
|
||||
window.matchMedia &&
|
||||
// TODO/Note I (Kurt) think '(prefers-reduced-motion: reduce)' and '(prefers-reduced-motion)' are equivalent, but not 100% sure
|
||||
window.matchMedia('(prefers-reduced-motion)').matches
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user