Skip to content

Commit 9f29b81

Browse files
committed
fix: handle -global keyframes
1 parent 89682a2 commit 9f29b81

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/svelte/src/compiler/phases/2-analyze/css/css-analyze.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ const css_visitors = {
6868
if (is_keyframes_node(node)) {
6969
if (!node.prelude.startsWith('-global-') && !is_in_global_block(context.path)) {
7070
context.state.keyframes.push(node.prelude);
71+
} else if (node.prelude.startsWith('-global-')) {
72+
// we don't check if the block.children.length because the keyframe is still added even if empty
73+
if (is_unscoped_global(context.path)) {
74+
context.state.has_unscoped_global.value = true;
75+
}
7176
}
7277
}
7378

0 commit comments

Comments
 (0)