Skip to content

Commit 385b6f0

Browse files
authored
Apply suggestions from code review
1 parent 22b5193 commit 385b6f0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.changeset/curly-balloons-relate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
'svelte': patch
33
---
44

5-
fix: correctly look for sibling elements inside blocks and components
5+
fix: correctly look for sibling elements inside blocks and components when pruning CSS

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,13 +651,17 @@ function get_following_sibling_elements(element, include_self) {
651651
if (node === element) {
652652
skip = false;
653653
if (include_self) siblings.push(node);
654-
} else if (!skip) siblings.push(node);
654+
} else if (!skip) {
655+
siblings.push(node);
656+
}
655657
},
656658
SvelteElement(node) {
657659
if (node === element) {
658660
skip = false;
659661
if (include_self) siblings.push(node);
660-
} else if (!skip) siblings.push(node);
662+
} else if (!skip) {
663+
siblings.push(node);
664+
}
661665
},
662666
RenderTag(node) {
663667
for (const snippet of node.metadata.snippets) {

0 commit comments

Comments
 (0)