Skip to content

Commit

Permalink
fix(language-core): generate empty scoped classname for :class
Browse files Browse the repository at this point in the history
  • Loading branch information
KazariEX committed Nov 2, 2024
1 parent 5f4c1e7 commit f275c2a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions packages/language-core/lib/codegen/template/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -685,11 +685,16 @@ function* generateReferencesForScopedCssClasses(
});

for (const literal of literals) {
const classes = collectClasses(
literal.text,
literal.end - literal.text.length - 1 + startOffset
);
ctx.scopedClasses.push(...classes);
if (literal.text) {
const classes = collectClasses(
literal.text,
literal.end - literal.text.length - 1 + startOffset
);
ctx.scopedClasses.push(...classes);
}
else {
ctx.emptyClassOffsets.push(literal.end - 1 + startOffset);
}
}

function walkArrayLiteral(node: ts.ArrayLiteralExpression) {
Expand Down

0 comments on commit f275c2a

Please sign in to comment.