- From: Gwern Branwen via GitHub <sysbot+gh@w3.org>
- Date: Tue, 02 Apr 2024 18:06:16 +0000
- To: public-css-archive@w3.org
If I may leave a note as an author: we noticed `text-wrap: pretty` had unexpectedly shipped, and, excited by the prospect of real Knuth-Plass layout in >60% of browsers (according to CanIUse), took a look at how it affects our website. Unfortunately, `pretty` in Chrome seems to not really do K-P as one would expect, and to be highly opinionated. While we like how it handles orphaned-words to bump them from 1 to 2, usually, we do not like the extremely aggressive removal of hyphenation, which results in drastic s t r e t c h e d lines with our justified text. (Here are 34 before-after pairs on Windows Chrome 123 on my site: https://share.obormot.net/temp/text-wrap_screenshots.zip Most of them show this behavior. This is on a wide desktop screen; presumably, if we checked thoroughly on very narrow screens like mobile, the stretching behavior would be far worse, because it usually is and that is why we had to add Hyphenopoly to fix bad browser hyphenation.) If we could opt into the orphaned-words bit, we would, and it's not obvious to me why bumping a word to the next line would *have* to change all the hyphenations & multiple lines as its tradeoff, but `pretty` seems to be a package deal right now, so we can't use it. I also can't seem to find any CSS property, under any name, which would achieve the same effect: the CSS `widow`/`orphan` line properties do totally different things, most people just burble enthusiastically about how `pretty` solves all your word-orphan problems (which it may, but little mention of drawbacks), and the suggestions after that seem to be either 'manually insert no-break space at the end of paragraphs everywhere forever' or 'run some wacky JS'. The opinionated package deal is also worrisome because given how aggressive the treatment of hyphenation is, and how this is not apparently part of any standard, why expect other browsers to adopt this opinion? We definitely wouldn't want to adopt it for Chrome, and then 5 years later discover (or worse, *not* discover) that it looks terrible on Firefox or Safari after they ship their particular flavor... (Looking into this was not assisted by the very confusing terminology. For example the [official Chrome blog](https://developer.chrome.com/blog/css-text-wrap-pretty/) which is some of the only documentation on what the shipped `pretty` does mentions that its treatment of orphan-words differs from the CSS `orphans`... which isn't about words at all, it's about lines.) -- GitHub Notification of comment by gwern Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3473#issuecomment-2032718416 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 2 April 2024 18:06:17 UTC