Skip to content

Fix text-pretty description #2210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/docs/text-wrap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ For performance reasons browsers limit text balancing to blocks that are ~6 line

### Pretty text wrapping

Use the `text-pretty` utility to prevent orphans (a single word on its own line) at the end of a text block:
Use the `text-pretty` utility to optimimise for wrapping prettiness rather than browser speed. Behaviour varies by browser but often involves more complicated text wrapping approaches such as preventing orphans (a single word on its own line) at the end of a text block:

<Figure>

Expand Down Expand Up @@ -139,6 +139,10 @@ Use the `text-pretty` utility to prevent orphans (a single word on its own line)

</Figure>

Browsers vary in their interpretation of prettiness but may include advanced typographic concepts such as:

> reducing the variation in length between lines; avoiding typographic rivers; prioritizing different classes of soft wrap opportunities, hyphenation opportunities, or justification opportunities; avoiding hyphenation on too many consecutive lines - [CSS Text Level 4 specification](https://drafts.csswg.org/css-text-4/#text-wrap-style)

### Responsive design

<ResponsiveDesign element="h1" property="text-wrap" defaultClass="text-pretty" featuredClass="text-balance" />