add(foundations): balanced text wrapping page#56
Merged
Conversation
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>
Deploying specification-website with
|
| 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 |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
New spec page: Balanced text wrapping under
foundations.Documents
text-wrap: balance(even out short heading wraps) andtext-wrap: pretty(avoid orphans in body copy) from thetext-wrapshorthand — the modern, declarative replacement for<br>/ line-break hacks. Degrades to normal wrapping where unsupported, so it needs no feature query.Why now
text-wrapis 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 andtext-wrap: balanceis now supported across Chromium, Firefox, and Safari;prettytrails (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: balanceon.prose-specheadings andtext-wrap: prettyon body paragraphs insrc/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
text-wrapshorthand — W3C CSS Working Group (leads the citation). MDN (canonical/Reference/Properties/text-wrap), Chrome for Developers, and WebKit for context.Status
recommended— a progressive enhancement a modern site should adopt; it is never a platform requirement (unsupported browsers simply wrap normally), so notrequiredper the status bar.Changes
src/content/spec/foundations/text-wrap.md(new, canonical sections, British English, ~470 words)src/styles/global.cssrelatedSlugswired reciprocally intofont-loadingandcolor-schemeaddedentry (2026-06-25-text-wrap.md)og-default/checklist/spec/foundationscategory)SKILL.md untouched — its page count reads "140+", still accurate at 149, so no digest recompute needed.
Verification
npm run buildpasses (149 pages indexed).npm run format:checkclean.npm run lint0 errors (1 pre-existing warning in an unrelated.astrofile).Opened as a draft for maintainer review — not for auto-merge.
🤖 Generated with Claude Code