From 7a1bf82b9828e5f1e972acf96afc5e9f99375fd7 Mon Sep 17 00:00:00 2001 From: EthanHealy01 Date: Wed, 13 Aug 2025 16:02:34 +0100 Subject: [PATCH] favor shrinking over breaking words on fitText --- frontend/src/components/shared/FitText.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/shared/FitText.tsx b/frontend/src/components/shared/FitText.tsx index 4951af42e..1772f55ac 100644 --- a/frontend/src/components/shared/FitText.tsx +++ b/frontend/src/components/shared/FitText.tsx @@ -59,8 +59,9 @@ const FitText: React.FC = ({ WebkitBoxOrient: lines > 1 ? ('vertical' as any) : undefined, WebkitLineClamp: lines > 1 ? (lines as any) : undefined, lineClamp: lines > 1 ? (lines as any) : undefined, - wordBreak: 'normal', - overflowWrap: lines === 1 ? ('normal' as any) : ('break-word' as any), + // Favor shrinking over breaking words; only break at natural spaces or softBreakChars + wordBreak: lines > 1 ? ('keep-all' as any) : ('normal' as any), + overflowWrap: 'normal', fontSize: fontSize ? `${fontSize}px` : undefined, };