FuruholmAnton
12/1/2017 - 8:39 PM

css.js

/**
 * Set CSS values on element
 *
 * @param {any} el
 * @param {Object} styles
 */
function css(el, styles) {
	if (!el) return;
	if (Array.isArray(el) || el instanceof NodeList) {
		el.forEach((n) => {
			css(n, styles);
		});
	} else {
		for (let [key, value] of entries(styles)) {
			el.style[key] = value;
		}
	}
}