diff --git a/scripts/content.js b/scripts/content.js index ee35da1..1e93d6b 100644 --- a/scripts/content.js +++ b/scripts/content.js @@ -51,7 +51,8 @@ const fix = () => { if (body) body.style.setProperty("overflow-y", "unset", "important"); if (facebook) facebook.style.setProperty("position", "unset", "important"); if (html) html.style.setProperty("overflow-y", "unset", "important"); - if (!loading) html.style.setProperty("opacity", "1", "important"); + if (body && !loading) body.style.setProperty("opacity", "1"); + if (html && !loading) html.style.setProperty("background-color", "initial"); }; /** diff --git a/styles/content.css b/styles/content.css index 41fc891..036a83d 100644 --- a/styles/content.css +++ b/styles/content.css @@ -1,3 +1,9 @@ -html { - opacity: 0 !important; +body { + opacity: 0; +} + +@media (prefers-color-scheme: dark) { + html { + background-color: #424242; + } }