A small JS enhancement
The opposite of a widowmaker: it reunites the last word with its line.
A widow is the short final line of a paragraph or heading left holding just one small word, orphaned below the rest of the text. Widowmender catches it after layout, borrows a sliver of tracking from the line above so the word gets pulled back up, and only reaches for a non‑breaking space if tightening alone can't rescue it.
Want to use Widowmender on your website? Download it from GitHub.
Hand-set here to show the failure mode plainly: a single word stranded on its own line, dangling below the rest of its paragraph.
Building in public changes how the
work feels, even when the finished
thing always turns out exactly the
same.
This paragraph is live: processed by Widowmender on load, on resize, and once webfonts settle. Narrow the box until a word strands itself on the last line, then keep dragging and watch the fix engage a beat later.
Every paragraph eventually runs out of room, and the line that's left over doesn't always land cleanly. Sometimes it's a single short word, stranded below a much longer line, looking like a mistake even though nothing about the writing was wrong after all.
Same script, same selector: no special-casing for headline type.
Add the class to anything you want protected, then call init once. No build step.