RE: [css3-text] Suggestion for text-overflow:shrink

The way I see it working (admittedly not necessarily the only way) is that since the container must be fixed-size, layout is unambiguous. If there is content that would fit in one line or two lines, it will fit in whatever will have bigger font (probably two lines, although that may need a proof). If it is desired that content stays in one line, "white-space:nowrap" is a way to ensure that.

I guess 'text-overflow' could be a fine way to achieve shrinking, but it implies that it would only apply to one line (which seems less useful than applying to a block), and it is not clear what happens to inline blocks (if inline blocks are not affected the fitting may not work; if they are it is not 'text' overflow any more.

On the other hand if fine control of how exactly text is adjusted to fit is desired, a property with 'text' prefix would be more appropriate. I have mixed feelings about that though. Fine control is good, but then UA is discouraged from applying the best technology available (even if some newly invented font adjustment is better, it will have to apply 'condense' when directed).

-----Original Message-----
From: Brad Kemper [] 
Sent: Wednesday, October 14, 2009 6:14 PM
To: Alex Mogilevsky
Cc: Tab Atkins Jr.; www-style list
Subject: Re: [css3-text] Suggestion for text-overflow:shrink

On Oct 14, 2009, at 4:54 PM, Alex Mogilevsky <>

> 1) The property is 'overflow'
> 2) new 'overflow' values (I don't know if all values are needed - 
> that's a decision independent from the rest of it):
>    overflow:shrink -- shrink but not stretch
>    overflow:stretch -- stretch but not shrink
>    overflow:fit    -- shrink or stretch for exact fit

So, if I have a two word sentence with 'overflow:fit' and it doesn't fit naturally, is it wrapped to two lines and then resized, or resized so that it all fits on one line?

To me, these values seem more natural as values for 'text-overflow', where some text has already been restricted to a single line (due to a long word in a small space, or via white-space value), and 'overflow- y' is already not involved.

That would have worked for TJ's original use case of getting a line of unbroken centered text into a limited width box. It would also work for shrinking a long unhyphenated word in a narrow column of text. I would go with:

text-overflow: condense; /* squeeze letterforms horizontally or use condensed axis of typeface */
text-overflow: shrink; /* reduce font size */
text-overflow: kern-or-track; /* reduce space between letters even if they overlap */

A UA that could change the shape of the letters for 'condense' could fall back to one of the other two values.

I'm not a big fan of shrinking the text, which seems typographically inelegant. It would be pretty horrible in a large paragraph of text.  
They do it in newspaper headlines sometimes, but I think they often pick a bolder font to go with the smaller size. I don't think many Web pages would have the same sort of constraints and priorities as newspapers, where they have to cram a lot of words into narrow columns on a limited number of pages. I think 'condense' would be far more useful than 'shrink'. 

Received on Friday, 16 October 2009 01:54:22 UTC