File tree 4 files changed +22
-1
lines changed
src/compiler/phases/2-analyze/css
tests/css/samples/global-block
4 files changed +22
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' svelte ' : patch
3
+ ---
4
+
5
+ fix: don't include keyframes in global scope in the keyframes to rename
Original file line number Diff line number Diff line change @@ -28,11 +28,19 @@ function is_global_block_selector(simple_selector) {
28
28
) ;
29
29
}
30
30
31
+ /**
32
+ *
33
+ * @param {Array<AST.CSS.Node> } path
34
+ */
35
+ function is_in_global_block ( path ) {
36
+ return path . some ( ( node ) => node . type === 'Rule' && node . metadata . is_global_block ) ;
37
+ }
38
+
31
39
/** @type {CssVisitors } */
32
40
const css_visitors = {
33
41
Atrule ( node , context ) {
34
42
if ( is_keyframes_node ( node ) ) {
35
- if ( ! node . prelude . startsWith ( '-global-' ) ) {
43
+ if ( ! node . prelude . startsWith ( '-global-' ) && ! is_in_global_block ( context . path ) ) {
36
44
context . state . keyframes . push ( node . prelude ) ;
37
45
}
38
46
}
Original file line number Diff line number Diff line change 74
74
animation : svelte-xyz-test 1s ;
75
75
}
76
76
77
+ .y {
78
+ animation : test-in 1s ;
79
+ }
80
+
77
81
@keyframes test-in{
78
82
to {
79
83
opacity : 1 ;
Original file line number Diff line number Diff line change 76
76
animation : test 1s ;
77
77
}
78
78
79
+ .y {
80
+ animation : test-in 1s ;
81
+ }
82
+
79
83
@keyframes test-in {
80
84
to {
81
85
opacity : 1 ;
You can’t perform that action at this time.
0 commit comments