Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah, very weird.

Caniuse claims it's supported in Chrome: https://caniuse.com/mdn-css_properties_text-wrap_pretty

But you're right, it very clearly isn't working.

Is it a regression? Did it break and nobody noticed?

 help



From https://webkit.org/blog/16547/better-typography-with-text-wr...

"While support for pretty shipped in Chrome 117, Edge 177, and Opera 103 in Fall 2023, and Samsung Internet 24 in 2024, the Chromium version is more limited in what it accomplishes. According to an article by the Chrome team, Chromium only makes adjustments to the last four lines of a paragraph. It’s focused on preventing short last lines. It also adjusts hyphenation if consecutive hyphenated lines appear at the end of a paragraph."

The article goes on to talk about how it's up to the browser (and not necessarily permanent) about how to handle the setting, and furthermore a new value was agreed upon to do what Chromium was doing, called "text-wrap: avoid-short-last-lines".

Here's the article on what the Chromium version does: https://developer.chrome.com/blog/css-text-wrap-pretty/


Ah, OK. I finally got the demo to show a difference under one specific window width, where it changed the last line of a paragraph from one word to two words.

So it does exist... but yeah, barely does anything. Thank you for finding the explanation!


Amazing summary. Thank you so much!

I think the answer is in the post:

> Although Safari is the first browser to ship a non-joke implementation of text-wrap

(Emphasis mine.) Chrome is using a different algorithm for this, which probably fixes some typographic problems, but defaults to greed most of the time.


Interesting. As far as I can tell, Chrome isn't doing anything different. I can't find any window width where the checkbox makes any difference.

Edit: finally found it, see cousin comment.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: