aboutsummaryrefslogtreecommitdiff
path: root/element
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2025-11-12 19:08:24 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2025-11-12 19:08:24 +0100
commit40154dc1408f3eb7667985304d363848f40bbb1e (patch)
tree561cb6c082e2ded2496ac52e8a004807e2017301 /element
parentbf1fef8933e090ec92dbb04c66f9c868044c242f (diff)
element: update style attribute as a sub object instead of replacing it
Diffstat (limited to 'element')
-rw-r--r--element/index.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/element/index.js b/element/index.js
index f2b79ac..82c41ff 100644
--- a/element/index.js
+++ b/element/index.js
@@ -6,7 +6,11 @@ export function create(tag, options) {
if (options) {
Object.entries(options).forEach(([key, value]) => {
- element[key] = value;
+ if (key === 'style') {
+ Object.entries(value).forEach(([k, v]) => element['style'][k] = v)
+ } else {
+ element[key] = value;
+ }
})
}