Skip to content

Add text-wrap balance and pretty to complement existing white-space utils#41491

Open
mdo wants to merge 1 commit into
mainfrom
v5/text-wrap-utils
Open

Add text-wrap balance and pretty to complement existing white-space utils#41491
mdo wants to merge 1 commit into
mainfrom
v5/text-wrap-utils

Conversation

@mdo
Copy link
Copy Markdown
Member

@mdo mdo commented May 23, 2025

Fixes #41389 for v5. Complemented by #41490 for v6, which replaces the white-space utilities with all text-wrap.

…tils. In v6 we'll replace with all text-wrap utilities.
@mdo mdo added this to v5.4.0 May 23, 2025
@mdo mdo requested a review from a team as a code owner May 23, 2025 22:32
@github-project-automation github-project-automation Bot moved this to Needs review in v5.4.0 May 23, 2025
This text should be balanced. Here we’re writing a longer snippet of text to form a paragraph and demonstrate how the text wraps.
</div>`} />

Use `.text-pretty` to prevent single words their own line (orphans). **Pretty text wrapping is not fully supported in Safari and Firefox at the moment.**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a link to the Can I Use entry for this?
https://caniuse.com/mdn-css_properties_text-wrap_pretty

@coliff
Copy link
Copy Markdown
Contributor

coliff commented Jun 9, 2025

just a thought, text-pretty and text-balance class names aren't super obvious what they do. Perhaps they could be text-wrap-pretty and text-wrap-balance instead... There is already a text-wrap and these are a type of text-wrap so it makes sense to me to have wrap in the class name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Needs review

Development

Successfully merging this pull request may close these issues.

Class text balanced

2 participants