Skip to content

Commit b889a6d

Browse files
committed
tweak
1 parent b43132e commit b889a6d

File tree

1 file changed

+2
-5
lines changed
  • packages/svelte/src/compiler/phases/2-analyze/css

1 file changed

+2
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,8 @@ function apply_selector(relative_selectors, rule, element, stylesheet) {
196196

197197
// if this is the left-most non-global selector, mark it — we want
198198
// `x y z {...}` to become `x.blah y z.blah {...}`
199-
if (
200-
!parent_selectors.some(
201-
({ metadata }) => metadata.is_global || metadata.is_host || metadata.is_root
202-
)
203-
) {
199+
const parent = parent_selectors[parent_selectors.length - 1];
200+
if (!parent || is_global(parent, rule)) {
204201
mark(relative_selector, element);
205202
}
206203

0 commit comments

Comments
 (0)