aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/scripts/darktheme.js4
-rw-r--r--src/styles/style.css5
2 files changed, 6 insertions, 3 deletions
diff --git a/src/scripts/darktheme.js b/src/scripts/darktheme.js
index b44db9a..0c577b6 100644
--- a/src/scripts/darktheme.js
+++ b/src/scripts/darktheme.js
@@ -11,11 +11,11 @@ if (theme) {
function setTheme(dark) {
if (dark) {
- document.body.classList.add("dark-mode");
+ document.documentElement.classList.add("dark-mode");
themeButton.className = "fa fa-sun-o";
localStorage.setItem("theme", "dark");
} else {
- document.body.classList.remove("dark-mode");
+ document.documentElement.classList.remove("dark-mode");
themeButton.className = "fa fa-moon-o";
localStorage.setItem("theme", "light");
}
diff --git a/src/styles/style.css b/src/styles/style.css
index e0bac34..c65adc5 100644
--- a/src/styles/style.css
+++ b/src/styles/style.css
@@ -20,9 +20,12 @@
--theme-toggle: #f9e2af;
}
-body {
+html {
background-color: var(--bg);
color: var(--fg);
+}
+
+body {
font: 1em/1.8 'Open Sans', sans-serif;
margin: 0 auto;
max-width: 50em;