iveColorMode = localStorage.getItem("sppbActiveColorMode") || ""; activeColorMode = ""; const modes = []; if (!modes?.includes(activeColorMode)) { activeColorMode = ""; localStorage.setItem("sppbActiveColorMode", activeColorMode); } document?.body?.setAttribute("data-sppb-color-mode", activeColorMode); if (!localStorage.getItem("sppbActiveColorMode")) { localStorage.setItem("sppbActiveColorMode", activeColorMode); } if (window.sppbColorVariables) { const colorVariables = typeof (window.sppbColorVariables) === "string" ? JSON.parse(window.sppbColorVariables) : window.sppbColorVariables; for (const colorVariable of colorVariables) { const { path, value } = colorVariable; const variable = String(path[0]).trim().toLowerCase().replaceAll(" ", "-"); const mode = path[1]; const variableName = `${sppbColorVariablePrefix}-${variable}`; if (activeColorMode === mode) { colorVariableData.push(`${variableName}: ${value}`); } } document.documentElement.style.cssText += colorVariableData.join(";"); } }; window.sppbColorVariables = []; initColorMode(); document.addEventListener("DOMContentLoaded", initColorMode);
News & Events