You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CSS property word-break was designed for Chinese/Japanese/Korean line-breaking behavior, not Latin alphabets. For some reason (possibly due to MDN renaming its word-wrap article to overflow-wrap), a lot of newer Western websites abuse this property to break overlong words (URLs, long place names, etc.) if they get too large for the layout.
Two problems with that:
word-break: break-all breaks a word at the first character opportunity, instead of a natural word boundary.
Worse browser support than word-wrap: break-word, which goes back to old IE.
What should be tested exactly?
If an element has a non-initial computed word-break value, and that element’s lang doesn’t start with zh, ja, or ko, warn and suggest word-wrap/overflow-wrap instead. Like this:
🤯 Fascinating, I had no idea about any of this. What would be a good starting article to learn more about this?
Not sure how to clasify this hint, maybe pitfalls? @antross what do you think?
@tigt right now we are preparing for the next major release and breaking a few things in the API so it might take us a while to get to it. If you have time and want to work on it maybe we can help you?
Description
The CSS property
word-break
was designed for Chinese/Japanese/Korean line-breaking behavior, not Latin alphabets. For some reason (possibly due to MDN renaming itsword-wrap
article tooverflow-wrap
), a lot of newer Western websites abuse this property to break overlong words (URLs, long place names, etc.) if they get too large for the layout.Two problems with that:
word-break: break-all
breaks a word at the first character opportunity, instead of a natural word boundary.word-wrap: break-word
, which goes back to old IE.What should be tested exactly?
If an element has a non-initial computed
word-break
value, and that element’slang
doesn’t start withzh
,ja
, orko
, warn and suggestword-wrap
/overflow-wrap
instead. Like this:The text was updated successfully, but these errors were encountered: