Skip to content

Commit

Permalink
rename styles method to css - less ambiguity over what it returns, no…
Browse files Browse the repository at this point in the history
… style/styles confusion
  • Loading branch information
Rich-Harris committed May 3, 2017
1 parent b8affd4 commit 8da7019
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/shared/transitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function wrapTransition ( node, fn, params, intro, outgroup ) {
var ease = obj.easing || linear;

// TODO share <style> tag between all transitions?
if ( obj.styles ) {
if ( obj.css ) {
var style = document.createElement( 'style' );
}

Expand All @@ -58,8 +58,8 @@ export function wrapTransition ( node, fn, params, intro, outgroup ) {

this.callback = callback;

if ( obj.styles ) {
generateKeyframes( this.a, this.b, this.delta, this.duration, ease, obj.styles, node, style );
if ( obj.css ) {
generateKeyframes( this.a, this.b, this.delta, this.duration, ease, obj.css, node, style );
}

if ( !this.running ) {
Expand All @@ -74,13 +74,13 @@ export function wrapTransition ( node, fn, params, intro, outgroup ) {
},
done: function () {
if ( obj.tick ) obj.tick( intro ? 1 : 0 );
if ( obj.styles ) document.head.removeChild( style );
if ( obj.css ) document.head.removeChild( style );
this.callback();
this.running = false;
},
abort: function () {
if ( !intro && obj.tick ) obj.tick( 1 ); // reset styles for intro
if ( obj.styles ) document.head.removeChild( style );
if ( !intro && obj.tick ) obj.tick( 1 ); // reset css for intro
if ( obj.css ) document.head.removeChild( style );
this.running = false;
}
};
Expand Down

0 comments on commit 8da7019

Please sign in to comment.