feat(webui): refine mobile theme controls

Give every theme option a reliable 44-pixel touch target on mobile while retaining the denser desktop presentation.

Adjust the active indicator to preserve visual balance at both sizes and add tactile press feedback that follows the application's reduced-motion settings.
This commit is contained in:
DrSmoothl committed 2026-07-16 14:56:40 +08:00
1 parent a4bf838bfd
commit e842f6128b
1 file changed
+4 -3
@@ -18,7 +18,7 @@ export function ThemeToggle({ className }: { className?: string }) {
return (
<div
className={cn(
'relative inline-flex items-center gap-0.5 rounded-full border bg-card/60 p-0.5 shadow-xs',
'relative inline-flex shrink-0 items-center rounded-full border bg-card/60 p-0 shadow-xs md:p-0.5',
className
)}
>
@@ -31,15 +31,16 @@ export function ThemeToggle({ className }: { className?: string }) {
title={label}
aria-label={label}
onClick={() => setMode(m)}
data-press-scale=""
className={cn(
'relative flex size-7 items-center justify-center rounded-full transition-colors cursor-pointer',
'relative flex size-[44px] items-center justify-center rounded-full transition-[color,scale] duration-150 ease-out active:scale-[0.96] motion-reduce:active:scale-100 md:size-10 cursor-pointer',
active ? 'text-primary-foreground' : 'text-muted-foreground hover:text-foreground'
)}
>
{active && (
<motion.span
layoutId="theme-toggle-pill"
className="absolute inset-0 rounded-full bg-primary"
className="absolute inset-[8px] rounded-full bg-primary md:inset-1.5"
transition={{ type: 'spring', stiffness: 380, damping: 30 }}
/>
)}