Browse Source

add color scheme preview on hover in appearance dropdown

David Hill 1 month ago
parent
commit
dbc15d4816
1 changed files with 5 additions and 0 deletions
  1. 5 0
      packages/app/src/components/settings-general.tsx

+ 5 - 0
packages/app/src/components/settings-general.tsx

@@ -62,6 +62,11 @@ export const SettingsGeneral: Component = () => {
                 value={(o) => o.value}
                 value={(o) => o.value}
                 label={(o) => o.label}
                 label={(o) => o.label}
                 onSelect={(option) => option && theme.setColorScheme(option.value)}
                 onSelect={(option) => option && theme.setColorScheme(option.value)}
+                onHighlight={(option) => {
+                  if (!option) return
+                  theme.previewColorScheme(option.value)
+                  return () => theme.cancelPreview()
+                }}
                 variant="secondary"
                 variant="secondary"
                 size="small"
                 size="small"
               />
               />