diff --git a/src/components/Header.astro b/src/components/Header.astro index 5fe46a1..2e935b2 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -9,12 +9,12 @@ import ThemeIcon from './ThemeIcon.astro'; {SITE_TITLE} - - + about projects resume blog + \ No newline at end of file diff --git a/src/components/ThemeIcon.astro b/src/components/ThemeIcon.astro index 6aa9fd7..b78eacd 100644 --- a/src/components/ThemeIcon.astro +++ b/src/components/ThemeIcon.astro @@ -1,53 +1,51 @@ --- --- - - - - + + + - - - \ No newline at end of file + const element = document.documentElement; + element.classList.toggle("dark"); + + const isDark = element.classList.contains("dark"); + localStorage.setItem("theme", isDark ? "dark" : "light"); + } + + document.getElementById("themeToggle").addEventListener("click", handleToggleClick); + \ No newline at end of file diff --git a/src/styles/global.css b/src/styles/global.css index 109ac3d..f3a371c 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -16,13 +16,6 @@ html.dark { body { font-family: Verdana, sans-serif; - margin: auto; - padding: 20px; - max-width: 65ch; - text-align: left; - word-wrap: break-word; - overflow-wrap: break-word; - line-height: 1.5; } #themeToggle {