@cloudcome/utils-browser
Version:
cloudcome utils for browser
19 lines (18 loc) • 423 B
JavaScript
import { objectEach } from "@cloudcome/utils-core/object";
function setStyle(el, style) {
if (typeof style === "string") {
el.style.cssText = style;
} else {
objectEach(style, (value, key) => {
el.style.setProperty(key, value);
});
}
}
function getStyle(el, style) {
return window.getComputedStyle(el).getPropertyValue(style);
}
export {
getStyle,
setStyle
};
//# sourceMappingURL=dom.mjs.map