Skip to content

✨ .balancedText(): even lines, no one-word last line - #11

Merged
dryan merged 1 commit into
mainfrom
balanced-text
Oct 3, 2026
Merged

dryan merged 1 commit into
mainfrom
balanced-text

Conversation

@dryan-gh-actions

Copy link
Copy Markdown
Contributor

iOS has no text-wrap: pretty. lineBreakStrategy = .pushOut was tested
(UILabel and attributed Text) and leaves a one-word last line alone.

balancedText() lays a Text out at the narrowest width that keeps the
line count it has at the proposed width (CSS text-wrap: balance), as
a Layout around the text. The width search is a pure function with
tests; the kit applies it to every header title and headline, and
apps apply it to their own message paragraphs.

Co-Authored-By: Claude Sonnet 5.5 noreply@anthropic.com

iOS has no text-wrap: pretty. lineBreakStrategy = .pushOut was tested
(UILabel and attributed Text) and leaves a one-word last line alone.

balancedText() lays a Text out at the narrowest width that keeps the
line count it has at the proposed width (CSS text-wrap: balance), as
a Layout around the text. The width search is a pure function with
tests; the kit applies it to every header title and headline, and
apps apply it to their own message paragraphs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@dryan-gh-actions
dryan-gh-actions Bot requested a review from a team October 3, 2026 21:58
@dryan
dryan merged commit 80fafd5 into main Oct 3, 2026
1 check passed
@dryan
dryan deleted the balanced-text branch October 3, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant