export function applyTheme()

in src/SDK.ts [369:387]


export function applyTheme(themeData: { [varName: string]: string }): void {

    if (!themeElement) {
        themeElement = document.createElement("style");
        themeElement.type = "text/css";
        document.head!.appendChild(themeElement);
    }

    const cssVariables = [];
    if (themeData) {
        for (const varName in themeData) {
            cssVariables.push("--" + varName + ": " + themeData[varName]);
        }
    }

    themeElement.innerText = ":root { " + cssVariables.join("; ") + " } body { color: var(--text-primary-color) }";

    dispatchEvent("themeApplied", { detail: themeData });
}