@lunalytics/ui
Version:
React based component library created to be used in Lunalytics
16 lines (15 loc) • 596 B
JavaScript
const d = (l, r = "lunaui") => {
const s = (n, u = [], o = []) => {
for (const a in n) {
if (!Object.prototype.hasOwnProperty.call(n, a)) continue;
const e = n[a], c = [...u, a], m = `--${[r, ...c].filter(Boolean).join("-")}`;
typeof e == "object" && e !== null && !Array.isArray(e) ? s(e, c, o) : o.push(`${m}: ${e};`);
}
return o.join(`
`);
}, i = s(l), t = document.getElementById("luna-ui-theme") || document.createElement("style");
t.id = "luna-ui-theme", t.textContent = `:root{${i}}`, document.head.appendChild(t);
};
export {
d as setCSSVariables
};