From 61de0d729c15db2d316e32384e26b07d5c174956 Mon Sep 17 00:00:00 2001 From: Darin_Thompson Date: Wed, 24 Sep 2025 23:32:43 -0700 Subject: [PATCH] fix: Header bg-color remains white in dark theme Header bg-color calls "var(--bg-primary"). When in the light theme from :root and the dark from [data-theme='dark']. Found that :root --bg-primary was always being used regardless of the chosen theme. Modified lines 68 and 70 in script.js --- Landing page/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Landing page/script.js b/Landing page/script.js index 657f45c..7f00a1a 100644 --- a/Landing page/script.js +++ b/Landing page/script.js @@ -65,9 +65,9 @@ window.addEventListener('scroll', () => { const header = document.querySelector('.header'); if (window.scrollY > 100) { - header.style.background = `${getComputedStyle(document.documentElement).getPropertyValue('--bg-primary')}95`; + header.style.background = `${getComputedStyle(header).getPropertyValue('--bg-primary')}95`; } else { - header.style.background = getComputedStyle(document.documentElement).getPropertyValue('--bg-primary'); + header.style.background = getComputedStyle(header).getPropertyValue('--bg-primary'); } });