Skip to content

Commit a3858c2

Browse files
authored
Merge pull request #28 from exoticknight/master
fix: #207
2 parents b996432 + d3b96eb commit a3858c2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/style-compiler/plugins/scope-id.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@ module.exports = postcss.plugin('add-id', function (opts) {
7272
if (/-?animation$/.test(decl.prop)) {
7373
decl.value = decl.value.split(',')
7474
.map(v => {
75-
var vals = v.split(/\s+/)
76-
var name = vals[0]
77-
if (keyframes[name]) {
78-
return [keyframes[name]].concat(vals.slice(1)).join(' ')
75+
var vals = v.trim().split(/\s+/)
76+
var i = vals.findIndex(val => keyframes[val])
77+
if (i !== -1) {
78+
vals.splice(i, 1, keyframes[vals[i]])
79+
return vals.join(' ')
7980
} else {
8081
return v
8182
}

0 commit comments

Comments
 (0)