From 039b38ac8c77e1d6d0b2ad10e561cb0bade5d0bd Mon Sep 17 00:00:00 2001 From: Jonas_Jones Date: Fri, 1 Aug 2025 13:29:35 +0200 Subject: [PATCH] fixed font scaling on specific widths --- src/routes/+page.svelte | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 0fe59b6..c529903 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -190,8 +190,14 @@ Bingo Item 25`; while (cell.scrollHeight > cell.clientHeight || cell.scrollWidth > cell.clientWidth) { fontSize--; cell.style.fontSize = `${fontSize}px`; - if (fontSize < 12) break; // Minimum font size limit - } + if (fontSize < 10) break; // Minimum font size limit + }; + fontSize -= 2; // Reduce font size a bit more for better fit + fontSize = Math.max(fontSize, 8); // Ensure font size doesn't go below 8px + cell.style.fontSize = `${fontSize}px`; + // apply wrapping after font adjustment + cell.style.wordBreak = 'break-word'; + cell.style.overflowWrap = 'break-word'; }); }