summaryrefslogtreecommitdiff
path: root/src/codegen/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen/index.ts')
-rw-r--r--src/codegen/index.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/codegen/index.ts b/src/codegen/index.ts
index 3257d9936..9b3104f0a 100644
--- a/src/codegen/index.ts
+++ b/src/codegen/index.ts
@@ -190,7 +190,6 @@ export async function codegen(ast: Ast, { compileOptions }: CodeGenOptions): Pro
let collectionItem: JsxItem | undefined;
let currentItemName: string | undefined;
let currentDepth = 0;
- const classNames: Set<string> = new Set();
walk(ast.html, {
enter(node: TemplateNode) {
@@ -275,6 +274,11 @@ export async function codegen(ast: Ast, { compileOptions }: CodeGenOptions): Pro
this.skip();
return;
}
+ case 'Style': {
+ const attributes = getAttributes(node.attributes);
+ items.push({ name: 'style', jsx: `h("style", ${attributes ? generateAttributes(attributes) : 'null'}, ${JSON.stringify(node.content.styles)})` });
+ break;
+ }
case 'Text': {
const text = getTextFromAttribute(node);
if (mode === 'SLOT') {
@@ -328,6 +332,9 @@ export async function codegen(ast: Ast, { compileOptions }: CodeGenOptions): Pro
collectionItem = undefined;
}
return;
+ case 'Style': {
+ return;
+ }
default:
throw new Error('Unexpected node type: ' + node.type);
}