examples/dist/common.js
function animationName(val) {
        if (typeof val !== "object") {
            return val;
        }

        // Generate a unique name based on the hash of the object. We can't
        // just use the hash because the name can't start with a number.
        // TODO(emily): this probably makes debugging hard, allow a custom
        // name?
        var name = 'keyframe_' + (0, _util.hashObject)(val);

        // Since keyframes need 3 layers of nesting, we use `generateCSS` to
        // build the inner layers and wrap it in `@keyframes` ourselves.
        var finalVal = '@keyframes ' + name + '{';
        Object.keys(val).forEach(function (key) {
            finalVal += (0, _generate.generateCSS)(key, [val[key]], stringHandlers, false);
        });
        finalVal += '}';

        injectGeneratedCSSOnce(name, finalVal);

        return name;
    }
function animationName(val) {
        if (typeof val !== "object") {
            return val;
        }

        // Generate a unique name based on the hash of the object. We can't
        // just use the hash because the name can't start with a number.
        // TODO(emily): this probably makes debugging hard, allow a custom
        // name?
        var name = 'keyframe_' + (0, _util.hashObject)(val);

        // Since keyframes need 3 layers of nesting, we use `generateCSS` to
        // build the inner layers and wrap it in `@keyframes` ourselves.
        var finalVal = '@keyframes ' + name + '{';
        Object.keys(val).forEach(function (key) {
            finalVal += (0, _generate.generateCSS)(key, [val[key]], stringHandlers, false);
        });
        finalVal += '}';

        injectGeneratedCSSOnce(name, finalVal);

        return name;
    }
function animationName ( val ) { if ( typeof val !== "object" ) { return val ; } // Generate a unique name based on the hash of the object. We can't // just use the hash because the name can't start with a number. // TODO(emily): this probably makes debugging hard, allow a custom // name? var name = 'keyframe_' + ( 0 , _util . hashObject ) ( val ) ; // Since keyframes need 3 layers of nesting, we use `generateCSS` to // build the inner layers and wrap it in `@keyframes` ourselves. var finalVal = '@keyframes ' + name + '{' ; Object . keys ( val ) . forEach ( function ( key ) { finalVal += ( 0 , _generate . generateCSS ) ( key , [ val [ key ] ] , stringHandlers , false ) ; } ) ; finalVal += '}' ; injectGeneratedCSSOnce ( name , finalVal ) ; return name ; }
With animationName we look for an object that contains keyframes and inject them as an `@keyframes` block, returning a uniquely generated name. The keyframes object should look like animationName: { from: { left: 0, top: 0, }, '50%': { left: 15, top: 5, }, to: { left: 20, top: 20, } } TODO(emily): `stringHandlers` doesn't let us rename the key, so I have to use `animationName` here. Improve that so we can call this `animation` instead of `animationName`.
With animationName we look for an object that contains keyframes and inject them as an