Skip to content

Commit 81169ee

Browse files
feat(rdom): support setting CSS vars via $style()
1 parent 1b25582 commit 81169ee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/rdom/src/dom.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -457,11 +457,11 @@ export const $style = (el: Element, rules: string | any) => {
457457
if (isString(rules)) {
458458
el.setAttribute("style", rules);
459459
} else {
460-
const style: any = (<HTMLElement>el).style;
460+
const style = (<HTMLElement>el).style;
461461
for (let id in rules) {
462462
let v = deref(rules[id]);
463463
isFunction(v) && (v = v(rules));
464-
style[id] = v != null ? v : "";
464+
style.setProperty(id, v != null ? v : "");
465465
}
466466
}
467467
};

0 commit comments

Comments
 (0)