Skip to content

Commit 212fe9c

Browse files
committed
tweak
1 parent 0cac25c commit 212fe9c

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ const css_visitors = {
7070
context.state.keyframes.push(node.prelude);
7171
} else if (node.prelude.startsWith('-global-')) {
7272
// we don't check if the block.children.length because the keyframe is still added even if empty
73-
if (!context.state.has_unscoped_global.value && is_unscoped_global(context.path)) {
74-
context.state.has_unscoped_global.value = true;
75-
}
73+
context.state.has_unscoped_global.value ||= is_unscoped_global(context.path);
7674
}
7775
}
7876

@@ -97,14 +95,10 @@ const css_visitors = {
9795
}
9896

9997
if (idx === 0) {
100-
if (
101-
!context.state.has_unscoped_global.value &&
102-
is_unscoped_global(context.path, context.state.rule) &&
103-
context.state.rule &&
104-
context.state.rule.block.children.length > 0
105-
) {
106-
context.state.has_unscoped_global.value = true;
107-
}
98+
context.state.has_unscoped_global.value ||=
99+
!!context.state.rule &&
100+
context.state.rule.block.children.length > 0 &&
101+
is_unscoped_global(context.path, context.state.rule);
108102
}
109103
}
110104
}

0 commit comments

Comments
 (0)