Skip to content

Commit 43cd215

Browse files
author
auto-bot
committed
fix: improve toggle slider visibility with better contrast and blue ON state
- Darkened OFF state background (gray-300/gray-700) - Added border to track for better definition - Enhanced knob contrast with shadow - Changed ON state to vibrant blue (blue-500/blue-600) for better visibility - Makes toggle states immediately distinguishable at a glance
1 parent fcb9aaf commit 43cd215

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/app/_components/ui/toggle.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ const Toggle = React.forwardRef<HTMLInputElement, ToggleProps>(
2222
{...props}
2323
/>
2424
<div className={cn(
25-
"w-11 h-6 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary/20 rounded-full peer after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 dark:after:border-gray-500 after:border after:rounded-full after:h-5 after:w-5 after:transition-transform after:duration-300 after:ease-in-out transition-colors duration-300 ease-in-out",
25+
"w-11 h-6 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary/20 rounded-full peer after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 dark:after:border-gray-500 after:border after:rounded-full after:h-5 after:w-5 after:transition-transform after:duration-300 after:ease-in-out after:shadow-md transition-colors duration-300 ease-in-out border-2 border-gray-300 dark:border-gray-600",
2626
checked
27-
? "bg-primary after:translate-x-full"
28-
: "bg-gray-200 dark:bg-gray-600",
27+
? "bg-blue-500 dark:bg-blue-600 after:translate-x-full"
28+
: "bg-gray-300 dark:bg-gray-700",
2929
className
3030
)} />
3131
</label>

0 commit comments

Comments
 (0)