From 25091dbd605aa6aae44881306d70b4137eaf0711 Mon Sep 17 00:00:00 2001 From: Maurice Date: Fri, 6 Nov 2026 21:57:10 +0100 Subject: [PATCH] fix(mobile): switches keep their knob inside the track at every text size The track was w-10, which is rem and followed the text size setting, while the knob and its travel are px; with a smaller text size the knob hung over the end of the track. The track is 40 px now. --- client/src/mobile/components/MToggle.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/mobile/components/MToggle.tsx b/client/src/mobile/components/MToggle.tsx index b8938d7cd..1f11d37b0 100644 --- a/client/src/mobile/components/MToggle.tsx +++ b/client/src/mobile/components/MToggle.tsx @@ -20,7 +20,9 @@ export default function MToggle({ checked, onChange, ariaLabel, disabled = false selectionHaptic() onChange(!checked) }} - className={`box-border h-[22px] w-10 flex-none rounded-full p-[2px] transition-colors duration-[180ms] disabled:opacity-50 ${ + // Width in px like the knob and its travel: w-10 is rem and followed the text size, + // so a smaller text setting left the knob hanging over the end of the track. + className={`box-border h-[22px] w-[40px] flex-none rounded-full p-[2px] transition-colors duration-[180ms] disabled:opacity-50 ${ checked ? 'bg-m-act' : 'bg-[color:var(--m-trackoff)]' } ${className}`} >