We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c716cf6 commit 348c1d7Copy full SHA for 348c1d7
assets/scripts/theme.js
@@ -17,6 +17,14 @@ if (localTheme === themeDark) {
17
bodyClassList.add(themeDark);
18
}
19
20
+// Set background for overscroll (or elastic scrolling in OSX)
21
+function setBodyBackground(color) {
22
+ const tc = document.querySelector(".theme-container");
23
+ const cs = window.getComputedStyle(tc);
24
+ document.body.style.background = cs.background;
25
+}
26
+setBodyBackground();
27
+
28
// Toggle theme on click
29
themeToggle.addEventListener("click", () => {
30
if (bodyClassList.contains(themeDark)) {
@@ -26,4 +34,5 @@ themeToggle.addEventListener("click", () => {
34
35
localStorage.setItem(preferTheme, themeDark);
36
37
+ setBodyBackground();
38
});
0 commit comments