Skip to content

Commit

Permalink
patch animation namespacing (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
thysultan authored and nkzawa committed Jan 16, 2017
1 parent e9550f3 commit 3d384c9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/style-transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,15 @@

// animation: a, n, i characters
if (first === 97 && second === 110 && third === 105) {
line = line.substring(0, line.length-1);

var ninth = line.charCodeAt(9) || 0;
var tenth = line.charCodeAt(10) || 0;

var colon = line.indexOf(':')+1;
var build = line.substring(0, colon);

var anims = line.substring(colon).split(',');
var anims = line.substring(colon).trim().split(',');

// short hand animation syntax
if (ninth !== 45) {
Expand Down Expand Up @@ -209,6 +211,8 @@
build += (tenth !== 110 ? '' : animationSuffix) + anims[0].trim();
}

build += ';';

// vendor prefix
line = '-webkit-' + build + '-moz-' + build + build;
}
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/transform.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ p :global(span:not(.test)) {

p, h1 {
color: blue;
animation: hahaha 3s ease forwards infinite;
animation-name: hahaha;
animation-delay: 100ms;
}
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/transform.out.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3d384c9

Please sign in to comment.