← Back to release summary

overflow-wrap: anywhere

Category
CSS
Type
New or changed feature
Status
Enabled by default (Chrome 80)
Intent stage
Evaluate readiness to ship

Summary

The new value 'anywhere' allows an otherwise unbreakable sequence of characters to be broken at an arbitrary point if there are no otherwise-acceptable break points in a line. Additionally, soft wrap opportunities introduced by 'anywhere' are considered when calculating min-content intrinsic sizes.

Motivation

This feature address a long standing web compatibility issue related to the 'word-break: break-word' feature. The CSS Text 3 spec still allows the 'break-word' value to ensure compatibility (Safari and Chrome support it), but its marked as deprecated; that's why Firefox doesn't implement it. The 'word-break: break-word' feature provides a behavior that web authors really appreciate, which consist on breaking opportunities account for the min-content size. Several approaches have been explored, but all of them lead to serious web compatibility issues, so that the CSS WG resolved that a new CSS value should be the best solution.

Standards & signals

Docs: https://drafts.csswg.org/css-text-3/#valdef-overflow-wrap-anywhere

Samples: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap https://www.cjcid.com/articles/wrapping-long-words-css-html/

Explainers: https://github.com/w3c/csswg-drafts/issues/2682

View on chromestatus.com