diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 4a9fde3a0..33b807c76 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -519,18 +519,6 @@ export default function Wrapper({ initialSettings, fallback }) { } } - const wrapperStyle = backgroundImage - ? { - backgroundImage: `linear-gradient(rgb(var(--bg-color) / ${opacity}), rgb(var(--bg-color) / ${opacity})), url('${backgroundImage}')`, - backgroundSize: "cover", - backgroundPosition: "center", - backgroundAttachment: "fixed", - backgroundRepeat: "no-repeat", - } - : { - backgroundColor: "rgb(var(--bg-color))", - }; - useEffect(() => { const html = document.documentElement; const body = document.body; @@ -540,31 +528,40 @@ export default function Wrapper({ initialSettings, fallback }) { html.classList.add(theme === "dark" ? "scheme-dark" : "scheme-light"); html.classList.remove(...Array.from(html.classList).filter((cls) => cls.startsWith("theme-"))); - const themeClass = initialSettings.color ? `theme-${initialSettings.color}` : "theme-slate"; - html.classList.add(themeClass); + html.classList.add(`theme-${initialSettings.color || "slate"}`); - return () => { - // Clean up background-related styles - body.style.backgroundImage = ""; - body.style.backgroundColor = ""; - }; + // Remove any previously applied inline styles + body.style.backgroundImage = ""; + body.style.backgroundColor = ""; + body.style.backgroundAttachment = ""; }, [backgroundImage, opacity, theme, initialSettings.color]); return ( -
-
- + <> + {backgroundImage && ( + + ); } diff --git a/src/styles/globals.css b/src/styles/globals.css index a638c7c57..be85ae43c 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -24,11 +24,25 @@ } } +html, +body, #__next { + height: 100%; margin: 0; padding: 0; } +#background { + position: fixed; + inset: 0; + z-index: -1; + background-size: cover; + background-position: center; + background-repeat: no-repeat; + background-attachment: scroll; + pointer-events: none; +} + html, body { font-family: Manrope, "Manrope-Fallback", Arial, sans-serif;