Orphan words
Skill diodames/orphan-words
Prevents orphan words and awkward last-line wraps using CSS text-wrap (balance/pretty/stable), editorial , and nowrap phrase binders. Use when editing prose or headings, reviewing typography/line breaks, or when the user mentions orphans, widows, last-line wrapping, , non-breaking space, text-wrap, text-wrap-style, balance, pretty, or stable.From its SKILL.md
npx -y skills add diodames/orphan-wordsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.9 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it
Orphan words
Prevent single short words (and short trailing phrases) from sitting alone on a line. Prefer CSS first; use hand-authored glue for what CSS cannot fix. Do not invent a JS rewriter or CSS orphans/widows unless the project already uses them.
Quick Reference
| Category | When to Use |
|---|---|
| CSS wrapping | text-wrap: balance / pretty, Tailwind classes, when to skip |
| Editorial glue | , phrase binders, false positives |
Workflow
- Check the measure — a too-narrow column causes orphans that no glue fixes cleanly; confirm the container has a sane measure before patching text
- CSS role split — headings/short titles →
text-wrap: balance; body/ledes/meta →text-wrap: pretty;contenteditable/animated text →text-wrap-style: stable - Preserve existing glue — keep
and nowrap binders when editing nearby copy; re-apply the same rules to new sentences - Editorial
— glue short function words, multi-word titles/units, and end-of-phrase clusters (not a pure “last two words” rule); scope to non-translated copy only - Phrase binder — wrap preposition + linked name in
white-space: nowrap(e.g..text-bind) - Skip false positives — animation spaces, date/sr-only nowrap, print
orphans/widows, CJK/non-space-delimited scripts - Verify — check the result at a narrow and a wide viewport (e.g. ~360px and ~1440px); confirm no new orphan or overflow was introduced by a binder or
Core principles
1. CSS before content hacks
Let the browser improve wrapping first. Hand only for residual orphans CSS cannot fix (short words, titles, linked phrases).
2. Balance headings, pretty body
| Text role | Property |
|---|---|
| Headings / short titles | text-wrap: balance |
| Body / multi-line prose | text-wrap: pretty |
3. Glue with intent
Not every space needs . Target short function words (a, the, to, from, for, of, I, …), multi-word titles (Series B), and short trailing clusters that would orphan.
4. Bind linked phrases
Keep at Company (and similar) together with a nowrap wrapper so the preposition does not strand alone before a link.
5. Fix what's visibly bad, not everything
Chasing a perfectly even rag on every paragraph is its own defect (Butterick's rule). Apply this stack where an orphan actually reads as awkward, not as a blanket pass over all copy. Scope is English/Latin-script, non-translated copy by default — see editorial.md for i18n and CJK caveats.
Examples
<span class="text-bind">at <a href="...">Klarity</a></span> from first prototype until Series B.
I’m a product design leader … from prototype to Series B … I work with founders …
as a product partner … before the first design hire … when it’s time to scale.
Anti-patterns
| Mistake | Fix |
|---|---|
| Join last two words of every paragraph via script | Prefer pretty + selective |
| Over-nbsp mid-sentence on wide viewports | Glue only short words / titles / last-line clusters |
| Long nowrap binders | Keep binders short; avoid overflow on narrow screens |
Stripping during cleanup | Preserve glue when rewriting copy |
CSS orphans/widows or a JS rewriter | Use this stack unless the project already differs |
hardcoded into i18n-sourced strings | Scope glue to non-translated copy; see editorial.md |
balance/pretty applied blanket to CJK copy | Can break mid-word; see css.md |
| Chasing a perfect rag on every paragraph | Fix only visibly bad orphans |
Review checklist
- Column measure checked before reaching for glue
- Headings/titles use
text-wrap: balance - Body/ledes/meta use
text-wrap: pretty - Short function words and titles glued with
where needed - Preposition + linked name uses a nowrap binder
- Existing
/ binders preserved - No animation/date nowrap mistaken for orphan prevention
-
not hardcoded into translated/i18n-sourced strings -
balance/prettynot applied blanket to CJK or non-space-delimited scripts - Checked at a narrow and wide viewport after changes
Reference files
- css.md —
balance/pretty, Tailwind, browser notes - editorial.md —
, phrase binders, false positives
What ships with it: 3 files
8.9 KB alongside SKILL.md
- css.md4.4 KB
- editorial.md3.4 KB
- README.md1.2 KB