diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 9109b4bd3..c243c3ff4 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -554,48 +554,38 @@ export default function Wrapper({ initialSettings, fallback }) { html.classList.add(desiredThemeClass); } - if (backgroundImage) { - const safeBackgroundImage = backgroundImage.replace(/'/g, "\\'"); - body.style.backgroundImage = `linear-gradient(rgb(var(--bg-color) / ${opacity}), rgb(var(--bg-color) / ${opacity})), url('${safeBackgroundImage}')`; - body.style.backgroundSize = "cover"; - body.style.backgroundPosition = "center"; - body.style.backgroundAttachment = "fixed"; - body.style.backgroundRepeat = "no-repeat"; - body.style.backgroundColor = ""; - } else { - body.style.backgroundImage = "none"; - body.style.backgroundColor = "rgb(var(--bg-color))"; - body.style.backgroundSize = ""; - body.style.backgroundPosition = ""; - body.style.backgroundAttachment = ""; - body.style.backgroundRepeat = ""; - } - - return () => { - body.style.backgroundImage = ""; - body.style.backgroundColor = ""; - body.style.backgroundSize = ""; - body.style.backgroundPosition = ""; - body.style.backgroundAttachment = ""; - body.style.backgroundRepeat = ""; - }; + // Remove any previously applied inline styles + body.style.backgroundImage = ""; + body.style.backgroundColor = ""; + body.style.backgroundAttachment = ""; }, [backgroundImage, opacity, theme, color, initialSettings.color]); return ( -