diff --git a/js/dom.js b/js/dom.js index 339a793d..3c961b1f 100644 --- a/js/dom.js +++ b/js/dom.js @@ -278,6 +278,12 @@ function $create(selector = 'div', properties, children) { delete opt.attributes; } + if (opt.style) { + if (typeof opt.style === 'string') element.style.cssText = opt.style; + if (typeof opt.style === 'object') Object.assign(element.style, opt.style); + delete opt.style; + } + if (ns) { for (const attr in opt) { const i = attr.indexOf(':') + 1;