File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/svelte/src/compiler/phases/2-analyze/css Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ const css_visitors = {
70
70
context . state . keyframes . push ( node . prelude ) ;
71
71
} else if ( node . prelude . startsWith ( '-global-' ) ) {
72
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 ) ) {
73
+ if ( ! context . state . has_unscoped_global . value && is_unscoped_global ( context . path ) ) {
74
74
context . state . has_unscoped_global . value = true ;
75
75
}
76
76
}
@@ -98,6 +98,7 @@ const css_visitors = {
98
98
99
99
if ( idx === 0 ) {
100
100
if (
101
+ ! context . state . has_unscoped_global . value &&
101
102
is_unscoped_global ( context . path , context . state . rule ) &&
102
103
context . state . rule &&
103
104
context . state . rule . block . children . length > 0
@@ -227,7 +228,11 @@ const css_visitors = {
227
228
if ( idx !== - 1 ) {
228
229
is_global_block = true ;
229
230
if ( i === 0 ) {
230
- if ( is_unscoped_global ( context . path ) && node . block . children . length > 0 ) {
231
+ if (
232
+ ! context . state . has_unscoped_global . value &&
233
+ is_unscoped_global ( context . path ) &&
234
+ node . block . children . length > 0
235
+ ) {
231
236
context . state . has_unscoped_global . value = true ;
232
237
}
233
238
}
You can’t perform that action at this time.
0 commit comments