@atlaskit/motion
Version:
A set of utilities to apply motion in your application.
20 lines (19 loc) • 673 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isReducedMotion = void 0;
var _isMatchMediaAvailable = require("./is-match-media-available");
/**
* Use for any programatic motions needed at runtime.
* Will return `true` if the current user prefers reduced motion.
* This is generally set through OS preferences/settings.
*/
var isReducedMotion = exports.isReducedMotion = function isReducedMotion() {
if (!(0, _isMatchMediaAvailable.isMatchMediaAvailable)()) {
return false;
}
var _window$matchMedia = window.matchMedia('(prefers-reduced-motion: reduce)'),
matches = _window$matchMedia.matches;
return matches;
};