From 0288357d2d98f2d0d98e7f0e90f4bddad7f28f13 Mon Sep 17 00:00:00 2001 From: you Date: Mon, 23 Mar 2026 02:19:57 +0000 Subject: [PATCH] Fix: force nav bar gradient repaint on theme color change Some browsers cache CSS gradient paint and don't re-render when custom properties change. Force reflow by toggling background. --- public/customize.js | 7 +++++++ public/index.html | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/public/customize.js b/public/customize.js index 2d656fb7..f7fe5cf9 100644 --- a/public/customize.js +++ b/public/customize.js @@ -223,6 +223,13 @@ for (var key in THEME_CSS_MAP) { if (t[key]) document.documentElement.style.setProperty(THEME_CSS_MAP[key], t[key]); } + // Force nav bar to re-render gradient (some browsers cache gradient paint) + var nav = document.querySelector('.top-nav'); + if (nav) { + nav.style.background = 'none'; + void nav.offsetHeight; // force reflow + nav.style.background = ''; + } } function resetPreview() { diff --git a/public/index.html b/public/index.html index 9459e548..259c9cc2 100644 --- a/public/index.html +++ b/public/index.html @@ -101,6 +101,6 @@ - +