From 791fe66ccfbc18b8c132026277a5db7977be5704 Mon Sep 17 00:00:00 2001 From: Sindre Kjelsrud Date: Thu, 22 Feb 2024 15:22:10 +0100 Subject: [PATCH] :lipstick: make darkmode standard theme when no javascript Signed-off-by: Sindre Kjelsrud --- src/components/Footer.astro | 12 ++++++------ src/components/ThemeIcon.astro | 20 +++++++++---------- src/styles/global.css | 36 +++++++++++++++++----------------- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 7d3dd0e..638908d 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -8,9 +8,9 @@ const today = new Date(); const updateImageForTheme = () => { const currentTheme = document.documentElement.classList.contains('dark') ? 'dark' : 'light'; - githubImage.src = currentTheme === 'dark' ? '/socials/github_dark.svg' : '/socials/github_light.svg'; - spotifyImage.src = currentTheme === 'dark' ? '/socials/spotify_dark.svg' : '/socials/spotify_light.svg'; - webringImage.src = currentTheme === 'dark' ? '/socials/webring_dark.svg' : '/socials/webring_light.svg'; + githubImage.src = currentTheme === 'dark' ? '/socials/github_light.svg' : '/socials/github_dark.svg'; + spotifyImage.src = currentTheme === 'dark' ? '/socials/spotify_light.svg' : '/socials/spotify_dark.svg'; + webringImage.src = currentTheme === 'dark' ? '/socials/webring_light.svg' : '/socials/webring_dark.svg'; }; updateImageForTheme(); @@ -25,13 +25,13 @@ const today = new Date();
Sindre Kjelsrud © {today.getFullYear()}
diff --git a/src/components/ThemeIcon.astro b/src/components/ThemeIcon.astro index c95753c..0de47ca 100644 --- a/src/components/ThemeIcon.astro +++ b/src/components/ThemeIcon.astro @@ -12,12 +12,12 @@ border: 0; background: none; } - .sun { fill: #3B2C29; } - .moon { fill: transparent; } + .sun { fill: transparent; } + .moon { fill: #9AD3BB; } - :global(.dark) .sun { fill: transparent; } - :global(.dark) .moon { fill: #9AD3BB; } + :global(.dark) .sun { fill: #3B2C29; } + :global(.dark) .moon { fill: transparent; }