2023-09-09 21:15:43 +02:00
|
|
|
import * as dde_dom from "../index.js";
|
|
|
|
export * from "../index.js";
|
2024-05-22 21:43:49 +02:00
|
|
|
import * as dde_s from "../signals.js";
|
|
|
|
export * from "../signals.js";
|
2023-09-09 21:15:43 +02:00
|
|
|
Object.assign(globalThis, dde_dom, dde_s);
|
2024-05-22 21:43:49 +02:00
|
|
|
//import * as dde_dom from "../dist/esm-with-signals.js";
|
|
|
|
//export * from "../dist/esm-with-signals.js";
|
2023-10-13 20:57:21 +02:00
|
|
|
//Object.assign(globalThis, dde_dom);
|
|
|
|
export const style= createStyle();
|
2023-09-05 09:25:47 +02:00
|
|
|
|
|
|
|
function createStyle(){
|
2023-09-09 21:15:43 +02:00
|
|
|
const element= dde_dom.el("style");
|
2023-09-05 09:25:47 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|