Riff / Built on the open web / Styling

text-wrap

Balances a long title in the Listen app so no word is left alone.

The Listen page: the library, nine albums as drawn record covers
The library in the Listen app; opening an album sets its title large above the tracks.

How Riff uses it

When the Listen app opens a post, its title is set large beside the Play and Shuffle pills. If it wraps, balance splits it into lines of roughly equal length instead of a long first line and one word on the second.

Why

A heading that size orphans a single word easily, and the wrap point moves with the viewport.

Without it

The title wraps normally.

Where

Links open the source at the commit this page was published from.

Reference: text-wrap on MDN.