From 0324660a26684a5382b2c6c18cd0a4e9f0169631 Mon Sep 17 00:00:00 2001 From: Josh Kingsley Date: Sun, 26 Oct 2025 14:28:55 +0200 Subject: feat(web): add dummy toolbar + tailwindcss colors --- web/src/html.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'web/src/html.ts') diff --git a/web/src/html.ts b/web/src/html.ts index 5bfff21..8802e50 100644 --- a/web/src/html.ts +++ b/web/src/html.ts @@ -13,8 +13,14 @@ const h = new Proxy({} as ElementCreator, { (...args: any[]) => { const el = document.createElement(tag); - if (typeof args[0] === "object") { - Object.assign(el, args.shift()); + if (args[0]?.constructor === Object) { + const { dataset, ...attrs } = args.shift(); + + Object.assign(el, attrs); + + if (dataset) { + Object.assign(el.dataset, dataset); + } } el.append(...args.flat()); -- cgit v1.2.3