---
title: "Better typography with text-wrap pretty"
description: "WebKit's implementation of `text-wrap: pretty` in Safari Technology Preview 216 evaluates the whole paragraph rather than one line at a time."
url: "https://swe.quest/articles/better-typography-with-text-wrap-pretty-a217707b284078fd"
canonical: "https://webkit.org/blog/16547/better-typography-with-text-wrap-pretty/"
source: "WebKit"
published: "2025-04-08"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 16
tags: ["css","browsers","frontend"]
---

# Better typography with text-wrap pretty

A post on [WebKit](https://swe.quest/sources/webkit.md), published 2025-04-08, 16 min read, Deep dive. Original: [https://webkit.org/blog/16547/better-typography-with-text-wrap-pretty/](https://webkit.org/blog/16547/better-typography-with-text-wrap-pretty/)

## Summary

WebKit's implementation of \`text-wrap: pretty\` in Safari Technology Preview 216 evaluates the whole paragraph rather than one line at a time. It avoids short last lines, improves rag by targeting a wrap range short of the box edge, and reduces hyphenation; it does not yet address rivers. Chromium's version only adjusts the last four lines, and the CSS spec deliberately leaves the improvements up to each browser. Performance depends on paragraph length, not on how many elements use it, so typical paragraphs are safe. \`balance\` equalizes line lengths and can leave text narrower than its container, while \`pretty\` still fills the width, so the choice for headlines depends on the design.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [CSS](https://swe.quest/tags/css.md) (Web & mobile)
- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)

## Prerequisites

- CSS basics ([easy posts on CSS](https://swe.quest/tags/css.md?difficulty=easy))

## Keywords

text-wrap: pretty, text-wrap: balance, WebKit, Safari Technology Preview, CSS Text Level 4, Chromium

## Related posts

- [WebKit Features in Safari 17.5](https://swe.quest/articles/webkit-features-in-safari-17-5-db83d5ba970a4034.md): WebKit · 2024-05-13 · Medium · 9 min read · CSS, Browsers, Frontend
  Safari 17.5 ships seven features and 22 bug fixes, led by CSS additions: text-wrap: balance (with the text-wrap-style longhand), the light-dark() color function, @starting-style for entry transitions, and supports() conditions on @import rules.
- [WebKit Features in Safari 16.2](https://swe.quest/articles/webkit-features-in-safari-16-2-97104b4a5912e4d5.md): WebKit · 2022-12-13 · Medium · 4 min read · CSS, Browsers, Frontend
  Safari 16.2 focuses on cross-browser interoperability as part of Interop 2022, with Safari Technology Preview 159 passing 98.5% of the Interop tests.
- [Release Notes for Safari Technology Preview 243](https://swe.quest/articles/release-notes-for-safari-technology-preview-243-b654215c3d2767b1.md): WebKit · 2026-05-07 · Medium · 18 min read · Browsers, CSS, Accessibility, JavaScript
  Safari Technology Preview 243 ships WebKit changes 310600@main through 312007@main for macOS Tahoe and Sequoia.
- [WebKit Features in Safari 17.4](https://swe.quest/articles/webkit-features-in-safari-17-4-28d81cae61957dde.md): WebKit · 2024-03-05 · Medium · 31 min read · Browsers, CSS, Frontend
  Safari 17.4 ships 46 web platform features and 146 bug fixes, alongside completion of WebKit's multi-year rewrite of its inline layout engine.
- [WebKit Features in Safari 18.2](https://swe.quest/articles/webkit-features-in-safari-18-2-9cf887b031bc5207.md): WebKit · 2024-12-09 · Medium · 22 min read · Browsers, CSS, Frontend, WebAssembly
  Safari 18.2 ships 61 new WebKit features and 111 fixes, headlined by cross-document View Transitions (with view-transition-name: auto, transition classes and types, and pageswap/pagereveal events), CSS text-box trimming for optical alignment to cap height, and background-clip: border-area.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
