Skip to content

Instantly share code, notes, and snippets.

@sirtimbly
Last active November 13, 2018 22:27
Show Gist options
  • Save sirtimbly/93c1099a1f968f63453b62a304e551ea to your computer and use it in GitHub Desktop.
Save sirtimbly/93c1099a1f968f63453b62a304e551ea to your computer and use it in GitHub Desktop.
Stencil and Function UI rendering experiment
import { Component, Prop } from "@stencil/core";
import { $ as t } from "../../tachyons-styles";
import { $ } from "./app-root-styles";
import { h } from "@stencil/core/dist/renderer/vdom";
@Component({
tag: "app-root",
styleUrls: ["app-root.css", "../../tachyons.css"],
shadow: false
})
export class AppRoot {
@Prop({
reflectToAttr: true
})
message: string = "hello world";
render() {
return $.div.h(
$.header.headerBar.h(
t.div.h2.white_50.h("Functional Render Generated from CSS")
),
$.div.message.h(this.message)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment