Skip to content

Commit b4ad059

Browse files
committed
chore: simplify
1 parent 537ea54 commit b4ad059

File tree

1 file changed

+7
-13
lines changed
  • packages/svelte/src/compiler/phases/3-transform/css

1 file changed

+7
-13
lines changed

packages/svelte/src/compiler/phases/3-transform/css/index.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,14 @@ const visitors = {
238238
}
239239
}
240240

241-
if (relative_selector.selectors.some((s) => s.type === 'NestingSelector')) {
242-
// clean every global selector attached to Nesting before bailing out
243-
for (const selector of relative_selector.selectors) {
244-
if (selector.type === 'PseudoClassSelector' && selector.name === 'global') {
245-
remove_global_pseudo_class(selector);
246-
}
241+
// for any :global() at the middle of compound selector
242+
for (const selector of relative_selector.selectors) {
243+
if (selector.type === 'PseudoClassSelector' && selector.name === 'global') {
244+
remove_global_pseudo_class(selector);
247245
}
246+
}
247+
248+
if (relative_selector.selectors.some((s) => s.type === 'NestingSelector')) {
248249
continue;
249250
}
250251

@@ -256,13 +257,6 @@ const visitors = {
256257

257258
context.state.specificity.bumped = true;
258259

259-
// for any :global() at the middle of compound selector
260-
for (const selector of relative_selector.selectors) {
261-
if (selector.type === 'PseudoClassSelector' && selector.name === 'global') {
262-
remove_global_pseudo_class(selector);
263-
}
264-
}
265-
266260
let i = relative_selector.selectors.length;
267261
while (i--) {
268262
const selector = relative_selector.selectors[i];

0 commit comments

Comments
 (0)