UNPKG

295 BPlain TextView Raw
1/**
2 * Modify the CSS of a DOM.
3 * @param dom
4 * @param css
5 * @returns
6 */
7export function modifyCSS(dom: HTMLElement | null | undefined, css: { [key: string]: any }): HTMLElement {
8 if (!dom) return;
9
10 Object.keys(css).forEach((key) => {
11 dom.style[key] = css[key];
12 });
13 return dom;
14}