From c4c06e7fb8ef36f519c40afbf5efbbae23f59dda 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 2d656fb..f7fe5cf 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 9459e54..259c9cc 100644 --- a/public/index.html +++ b/public/index.html @@ -101,6 +101,6 @@ - +