1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-01-19 07:53:13 +01:00
2023-11-18 14:23:18 +01:00

18 lines
452 B
JavaScript

import { el } from "deka-dom-el";
document.head.append(
el("style").append(
".class1{ font-weight: bold; }",
".class2{ color: purple; }"
)
);
document.body.append(
el(component, { className: "class2", textContent: "Hello World!" }),
component({ className: "class2", textContent: "Hello World!" })
);
function component({ className, textContent }){
return el("div", { className: [ "class1", className ] }).append(
el("p", textContent)
);
}