Resource card cover: long words are truncated/clipped in the preview #23
Labels
No labels
bug
discussion
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
edufeed/edufeed-app#23
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
On generated resource card covers, long words are clipped horizontally instead of wrapping or shrinking. Screenshot:
In the screenshot "verantwortlich" renders as "verantwortlic" and "Verantwortung" as "Verantwortu" (feed cards from @Fortbildung_Religion).
Likely cause: the cover title typography uses a fixed font size with
overflow: hiddenand no hyphenation/overflow-wrap: anywhere/font scaling for long German compound words.Expected: full words visible — wrap with hyphenation (
hyphens: autowithlang="de") and/or scale the font down so the longest word fits.Fixed on branch
fix/issue-23-cover-truncation, merged intodev(e70d1fb0).Root cause: the cover title font sizes scaled only with container width (
cqi) and ignored word length, so long German compounds overflowed the card'soverflow: hiddenand got clipped.Fix: each title line now exports its longest-word length as a CSS custom prop and the CSS caps the font size with
min(ideal, budget / wordLength)— long words shrink to fit instead of clipping. Titles with pathological words (> 16 chars, e.g. „Donaudampfschifffahrtsgesellschaft“) route to the long-headline layout which wraps instead. Verified in the browser with the exact titles from the screenshot — „verantwortlich“ and „Verantwortung“ now render fully.