From 3f8869fd75d47e2c8575f57eb126d8f9d9d895f2 Mon Sep 17 00:00:00 2001 From: Gigi Date: Tue, 14 Oct 2025 09:58:47 +0200 Subject: [PATCH] refactor(theme): show color swatches instead of text labels - Replace text buttons with color swatches for theme selection - Use actual background colors to preview each theme - Add border for white swatch to make it visible - Tooltips show theme names on hover --- src/components/Settings/ThemeSettings.tsx | 84 ++++++++++------------- 1 file changed, 38 insertions(+), 46 deletions(-) diff --git a/src/components/Settings/ThemeSettings.tsx b/src/components/Settings/ThemeSettings.tsx index 22cbb662..a65c47d8 100644 --- a/src/components/Settings/ThemeSettings.tsx +++ b/src/components/Settings/ThemeSettings.tsx @@ -17,6 +17,19 @@ const ThemeSettings: React.FC = ({ settings, onUpdate }) => const showDarkColors = currentTheme === 'dark' || currentTheme === 'system' const showLightColors = currentTheme === 'light' || currentTheme === 'system' + // Color definitions for swatches + const darkColors = { + black: '#000000', + midnight: '#18181b', + charcoal: '#1c1c1e' + } + + const lightColors = { + 'paper-white': '#ffffff', + sepia: '#f4f1ea', + ivory: '#fffff0' + } + return (

Theme

@@ -50,58 +63,37 @@ const ThemeSettings: React.FC = ({ settings, onUpdate }) => {showDarkColors && (
- -
- - - + +
+ {Object.entries(darkColors).map(([key, color]) => ( +
onUpdate({ darkColorTheme: key as any })} + title={key.charAt(0).toUpperCase() + key.slice(1)} + /> + ))}
)} {showLightColors && (
- -
- - - + +
+ {Object.entries(lightColors).map(([key, color]) => ( +
onUpdate({ lightColorTheme: key as any })} + title={key.split('-').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(' ')} + /> + ))}
)}