File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
lib/style-compiler/plugins Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -32,17 +32,15 @@ module.exports = postcss.plugin('add-id', function (opts) {
32
32
} )
33
33
34
34
// If keyframes are found in this <style>, find and rewrite animation names
35
- // in declarations
36
- //
37
- // TODO: the keyframes tracking needs to be across multiple <style> tags
38
- // that belongs to the same component...
35
+ // in declarations.
36
+ // Caveat: this only works for keyframes and animation rules in the same
37
+ // <style> element.
39
38
if ( Object . keys ( keyframes ) . length ) {
40
39
root . walkDecls ( decl => {
41
40
// individual animation-name declaration
42
41
if ( / - ? a n i m a t i o n - n a m e $ / . test ( decl . prop ) ) {
43
42
decl . value = decl . value . split ( ',' )
44
- . map ( v => keyframes [ v . trim ( ) ] )
45
- . filter ( v => v )
43
+ . map ( v => keyframes [ v . trim ( ) ] || v . trim ( ) )
46
44
. join ( ',' )
47
45
}
48
46
// shorthand
You can’t perform that action at this time.
0 commit comments