1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-12-15 05:43:45 +01:00

🧱 move components, exports, and index files to examples directory

This commit is contained in:
2023-09-26 09:40:00 +02:00
parent 3823abc2d7
commit 7417565fa5
7 changed files with 7 additions and 1 deletions

31
examples/exports.js Normal file
View File

@@ -0,0 +1,31 @@
import * as dde_dom from "../index.js";
export * from "../index.js";
import * as dde_s from "../signals.js";
export * from "../signals.js";
// import { empty, namespace, on, dispatch } from "../index.js";
// import "../dist/dde-with-signals.js";
// Object.assign(globalThis, dde);
// import { el, on, off, S } from "../dist/esm-with-signals.js";
export const style= createStyle();
Object.assign(globalThis, dde_dom, dde_s);
function createStyle(){
const element= dde_dom.el("style");
const store= new WeakSet();
let host;
return {
element,
host(k, h= k.name){
if(store.has(k)) return { css: ()=> {} };
store.add(k);
host= h;
return this;
},
css(...args){
const textContent= String.raw(...args).replaceAll(":host", "."+host);
const className= host;
element.appendChild(el("#text", { textContent }));
return className;
}
};
}