Re: [csswg-drafts] [css-text] Preventing too-short final lines of blocks (Last Line Minimum Length) (#3473)

Further to [my comments](https://github.com/w3c/csswg-drafts/issues/2396#issuecomment-1459869795) in the above thread, and following @kojiishi's response, I talked at length with other designers at Clearleft and it was surprisingly difficult to come to a definitive conclusion, particularly around the exceptions. 

By which I mean: put simply one doesn't want just a single word on the final line of a block, but what's the effect of bringing down a word from the previous line in order to address that? If you were fixing this manually, there might be a ripple affect back up the paragraph until the best overall text shape is achieved. I doubt that's something a browser could afford to do, given the (understandable) reluctance to implement any justification routines beyond the crudest greedy method.

The best conclusion we could come up with was something similar to the [solution proposed](https://github.com/w3c/csswg-drafts/issues/3473#issuecomment-560136177) by @AmeliaBR. Set a minimum character length for the final line along with a maximum number of characters to bring down from the previous line. This would be conceptually similar to the [hyphenate-limit-chars property](https://drafts.csswg.org/css-text-4/#hyphenate-char-limits).

`min-last-line: 12 6`

where `12` is the minimum line length in characters, and `6` is the maximum number of characters that can be brought down from the previous line to make that so. If the `6` is omitted, it would assumed to be equal to the `12`.

It might be useful to some people for the same approach to be expressed as percentages of box width instead:

`min-last-line: 20% 10%` 

where `20%` is the minimum length of the final line in terms of percentage of box width, and `10%` is the maximum length that can be removed from the previous line.

It might be that the two methods (chars and %) could be mixed.

-- 
GitHub Notification of comment by clagnut
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3473#issuecomment-1474837736 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 18 March 2023 12:31:47 UTC