From d4821d18fb8d460ef822f1a4d138a8d6c6445fc3 Mon Sep 17 00:00:00 2001 From: Gigi Date: Tue, 14 Oct 2025 11:37:13 +0200 Subject: [PATCH] fix: improve highlight counter readability in light mode - Make highlight indicator color theme-aware - Only force white text color in overlay context (with hero image) - Let CSS handle text color in regular header for better light mode support - Fixes hard-to-read white text on light backgrounds --- src/components/ReaderHeader.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/ReaderHeader.tsx b/src/components/ReaderHeader.tsx index fac8575c..d6e348de 100644 --- a/src/components/ReaderHeader.tsx +++ b/src/components/ReaderHeader.tsx @@ -38,7 +38,7 @@ const ReaderHeader: React.FC = ({ const isLongSummary = summary && summary.length > 150 // Determine the dominant highlight color based on visibility and priority - const highlightIndicatorStyles = useMemo(() => { + const getHighlightIndicatorStyles = useMemo(() => (isOverlay: boolean) => { if (!highlights.length) return undefined // Count highlights by level that are visible @@ -65,7 +65,8 @@ const ReaderHeader: React.FC = ({ return { backgroundColor: `rgba(${rgb}, 0.1)`, borderColor: `rgba(${rgb}, 0.3)`, - color: '#fff' + // Only force white color in overlay context, otherwise let CSS handle it + ...(isOverlay && { color: '#fff' }) } }, [highlights, highlightVisibility, settings]) @@ -93,7 +94,7 @@ const ReaderHeader: React.FC = ({ {hasHighlights && (
{highlightCount} highlight{highlightCount !== 1 ? 's' : ''} @@ -133,7 +134,7 @@ const ReaderHeader: React.FC = ({ {hasHighlights && (
{highlightCount} highlight{highlightCount !== 1 ? 's' : ''}