Skip to content

Commit 9a7c373

Browse files
fix(svelte-scoped): correctly transform rules with only --at-apply (#4795)
Co-authored-by: Henrik Berglund <[email protected]>
1 parent 71d4dd8 commit 9a7c373

File tree

1 file changed

+9
-2
lines changed
  • packages-integrations/svelte-scoped/src/_preprocess/transformApply

1 file changed

+9
-2
lines changed

packages-integrations/svelte-scoped/src/_preprocess/transformApply/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,17 @@ async function parseApply({ s, uno, applyVariables }: TransformApplyContext, nod
5050
if (!utils.length)
5151
return
5252

53+
let end = childNode.loc!.end.offset
54+
55+
const maybeSemi = s.slice(end, end + 1)
56+
if (maybeSemi === ';') {
57+
end += 1
58+
}
59+
60+
s.remove(childNode.loc!.start.offset, end)
61+
5362
for (const util of utils)
5463
writeUtilStyles(util, s, node, childNode)
55-
56-
s.remove(childNode!.loc!.start.offset, childNode!.loc!.end.offset)
5764
}
5865

5966
function getChildNodeValue(childNode: CssNode, applyVariables: string[]): string | undefined {

0 commit comments

Comments
 (0)