Merge pull request #6627 from uinstinct/toggleswitch

fix: toggle switch marker styling
This commit is contained in:
Dallin Romney 2025-07-17 20:21:42 +02:00 • committed by GitHub
commit f06df57451
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -26,7 +26,7 @@ const ToggleSwitch: React.FC<ToggleSwitchProps> = ({
<div className="flex flex-row items-center gap-1">
{isToggled && !!showIfToggled && showIfToggled}
<div
className={`border-vsc-input-border bg-vsc-input-background flex items-center rounded-full border border-solid`}
className={`border-vsc-input-border bg-vsc-input-background relative flex items-center rounded-full border border-solid`}
onClick={disabled ? undefined : onToggle}
style={{
height: size,
@ -34,14 +34,14 @@ const ToggleSwitch: React.FC<ToggleSwitchProps> = ({
padding: size / 8,
}}
>
<div className="relative h-full w-full">
<div
className={`absolute left-1/4 top-0 h-full w-1/2 transform rounded-full border-[0.2px] border-solid transition-all ${isToggled ? "translate-x-1/2 brightness-150" : "-translate-x-1/2 brightness-75"}`}
style={{
backgroundColor: isToggled ? vscButtonBackground : "",
}}
/>
</div>
<div
className={`absolute left-1/4 transform rounded-full border-[0.2px] border-solid transition-all ${isToggled ? "translate-x-1/2 brightness-150" : "-translate-x-1/2 brightness-75"}`}
style={{
backgroundColor: isToggled ? vscButtonBackground : "",
height: size,
width: size,
}}
/>
</div>
</div>
</div>