1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-07-01 04:12:14 +02:00

Create DocumentFragment also with el()

This commit is contained in:
2023-11-06 14:04:27 +01:00
parent 324727cc0a
commit 0d70189908
14 changed files with 24 additions and 27 deletions

View File

@ -15,7 +15,7 @@ export function example({ src, language= "javascript" }){
.toString()
.replaceAll(' from "../../../index-with-signals.js";', ' from "https://cdn.jsdelivr.net/gh/jaandrle/deka-dom-el/dist/esm-with-signals.js";');
const id= "code-"+Math.random().toString(36).slice(2, 7);
return el("<>").append(
return el().append(
el("div", { id, className: example.name }).append(
el("pre").append(
el("code", { className: "language-"+language, textContent: code })

View File

@ -1,7 +1,7 @@
import { el, S } from "../../../index-with-signals.js";
const clicks= S(0);
document.body.append(
el("<>").append(
el().append(
el("p", S(()=>
"Hello World "+"🎉".repeat(clicks())
)),

View File

@ -21,7 +21,7 @@ export const css= styles()
`
.include(example_css);
export function body(pkg){
return el("<>").append(
return el().append(
el("h1", pageName(pkg)),
el("p").append(
"The library tries to provide pure JavaScript tool(s) to create reactive interfaces. ",

View File

@ -12,7 +12,7 @@ import { el } from "deka-dom-el";
* @param {object} def
* */
export function head({ id, title, description, pkg, path_target }){
return el("<>").append(
return el().append(
el("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }),
el("link", { rel: "stylesheet", href: stylesheetHref(path_target, id) }),
@ -23,7 +23,7 @@ export function head({ id, title, description, pkg, path_target }){
);
}
function metaTwitter({ name, description, homepage }){
return el("<>").append(
return el().append(
el("meta", { name: "twitter:card", content: "summary_large_image" }),
//el("meta", { name: "twitter:domain", content: "" }),
el("meta", { name: "twitter:url", content: homepage }),
@ -34,7 +34,7 @@ function metaTwitter({ name, description, homepage }){
);
}
function metaFacebook({ name, description, homepage }){
return el("<>").append(
return el().append(
el("meta", { name: "og:url", content: homepage }),
el("meta", { name: "og:title", content: name }),
el("meta", { name: "og:description", content: description }),