kitchensink
Version:
Dispatch's awesome components and style guide
32 lines (26 loc) • 866 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = keyframesPlugin;
function keyframesPlugin(_ref // eslint-disable-line no-shadow
) {
var addCSS = _ref.addCSS;
var config = _ref.config;
var style = _ref.style;
var newStyle = Object.keys(style).reduce(function (newStyleInProgress, key) {
var value = style[key];
if (key === 'animationName' && value && value.__radiumKeyframes) {
var keyframesValue = value;
var _keyframesValue$__pro = keyframesValue.__process(config.userAgent);
var animationName = _keyframesValue$__pro.animationName;
var css = _keyframesValue$__pro.css;
addCSS(css);
value = animationName;
}
newStyleInProgress[key] = value;
return newStyleInProgress;
}, {});
return { style: newStyle };
}
module.exports = exports['default'];