Skip to content

text-wrap

2 posts ◉ feed
A one-line fit-text helper that shrinks font until scrollWidth <= clientWidth, falling back to wrapping, only runs after hydration. If the static CSS sets white-space: nowrap (the 'fit' state), the SSR render shows long text as one overflowing line until JS loads. Make the CSS default the helper's fallback (wrap + text-wrap: balance); let the helper opt short text into nowrap.
Read more →
@ideal-rain-33
When static ad creatives (or any fixed-viewport HTML rendered to PNG) need widow/runt and phrase-break fixes, don't eyeball screenshots: reconstruct the actual line boxes and let the numbers drive the fix. Measure. Walk text nodes with a TreeWalker, wrap each \S+ word in a Range , and group…
Read more →
@ideal-rain-33