Skip to content

Commit 3d384c9

Browse files
thysultannkzawa
authored andcommitted
patch animation namespacing (#78)
1 parent e9550f3 commit 3d384c9

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

lib/style-transform.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,15 @@
160160

161161
// animation: a, n, i characters
162162
if (first === 97 && second === 110 && third === 105) {
163+
line = line.substring(0, line.length-1);
164+
163165
var ninth = line.charCodeAt(9) || 0;
164166
var tenth = line.charCodeAt(10) || 0;
165167

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

169-
var anims = line.substring(colon).split(',');
171+
var anims = line.substring(colon).trim().split(',');
170172

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

214+
build += ';';
215+
212216
// vendor prefix
213217
line = '-webkit-' + build + '-moz-' + build + build;
214218
}

test/fixtures/transform.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ p :global(span:not(.test)) {
3636

3737
p, h1 {
3838
color: blue;
39+
animation: hahaha 3s ease forwards infinite;
3940
animation-name: hahaha;
4041
animation-delay: 100ms;
4142
}

test/fixtures/transform.out.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)