mirror of
https://github.com/maputnik/editor.git
synced 2026-06-18 21:27:34 +00:00
Move accessibility checks into module.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import lodash from 'lodash'
|
||||
|
||||
|
||||
// Throttle for 3 seconds so when a user enables it they don't have to refresh the page.
|
||||
const reducedMotionEnabled = lodash.throttle(() => {
|
||||
return window.matchMedia("(prefers-reduced-motion: reduce)").matches
|
||||
}, 3000);
|
||||
|
||||
|
||||
export default {
|
||||
reducedMotionEnabled
|
||||
}
|
||||
Reference in New Issue
Block a user