Skip to content

add(foundations): balanced text wrapping page#56

Merged
jdevalk merged 3 commits into
mainfrom
standards-scan/text-wrap-2026-06-25
Jun 25, 2026
Merged

add(foundations): balanced text wrapping page#56
jdevalk merged 3 commits into
mainfrom
standards-scan/text-wrap-2026-06-25

Conversation

@jdevalk

@jdevalk jdevalk commented Jun 25, 2026

Copy link
Copy Markdown
Owner

What

New spec page: Balanced text wrapping under foundations.

Documents text-wrap: balance (even out short heading wraps) and text-wrap: pretty (avoid orphans in body copy) from the text-wrap shorthand — the modern, declarative replacement for <br> / &nbsp; line-break hacks. Degrades to normal wrapping where unsupported, so it needs no feature query.

Why now

text-wrap is the natural companion to our other "modern CSS platform feature" foundations pages (popover-api, color-scheme, the pending anchor-positioning). The shorthand reached Baseline 2024 and text-wrap: balance is now supported across Chromium, Firefox, and Safari; pretty trails (no Firefox yet) and is documented as a progressive enhancement. It's a genuine readability win that we had no page for.

Ship-it-before-you-spec-it

Same PR ships the worked example: text-wrap: balance on .prose-spec headings and text-wrap: pretty on body paragraphs in src/styles/global.css, commented with a back-reference to the page (matching the file's existing convention for scrollbar-gutter / view-transitions / dvh).

Primary source

Status

recommended — a progressive enhancement a modern site should adopt; it is never a platform requirement (unsupported browsers simply wrap normally), so not required per the status bar.

Changes

  • src/content/spec/foundations/text-wrap.md (new, canonical sections, British English, ~470 words)
  • Worked-example CSS in src/styles/global.css
  • relatedSlugs wired reciprocally into font-loading and color-scheme
  • Changelog added entry (2026-06-25-text-wrap.md)
  • OG images regenerated (new per-page image + count-driven og-default / checklist / spec / foundations category)

SKILL.md untouched — its page count reads "140+", still accurate at 149, so no digest recompute needed.

Verification

npm run build passes (149 pages indexed). npm run format:check clean. npm run lint 0 errors (1 pre-existing warning in an unrelated .astro file).

Opened as a draft for maintainer review — not for auto-merge.

🤖 Generated with Claude Code

New spec page documenting text-wrap: balance / pretty (CSS Text Module
Level 4) for intelligent line breaking on headings and body copy, plus
a worked-example implementation in the site's own stylesheet.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 25, 2026

Copy link
Copy Markdown

Deploying specification-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 40da3bc
Status: ✅  Deploy successful!
Preview URL: https://7fe3dd45.specification-website.pages.dev
Branch Preview URL: https://standards-scan-text-wrap-202.specification-website.pages.dev

View logs

pretty runs a slower wrapping algorithm with no line cap, so its cost
scales with how much text it touches — MDN cautions to reserve it for
body copy where layout matters more than speed. The page previously
called the whole feature "free and safe", which is true for balance
(line-capped, cheap) but misleading for pretty. Qualify the claim,
add the trade-off to "How to implement", and add a Common mistakes
bullet against blanket-applying it via a universal selector.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jdevalk jdevalk marked this pull request as ready for review June 25, 2026 08:03
@jdevalk jdevalk merged commit 9faae4e into main Jun 25, 2026
7 of 8 checks passed
@jdevalk jdevalk deleted the standards-scan/text-wrap-2026-06-25 branch June 25, 2026 08:03
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