text-oveflow for _multiline_ texts

Hello. It would be nice to be able to use text-overflow property for _multiline_ (and _multiword_) texts sothat _last_ visible line of text would be clipped same way as it currently happens with single-line texts.

This could be done by specifying maximum number of _lines_ to display (in addition to text-overflow type like 'ellipsis') _without_ making text unwrappable with {white-space: nowrap}:

Possible syntax:

    /* 'ln' unit means 'line' */
    DIV {text-overflow: 3ln ellipsis; }

This could be splitted/expanded to following subproperties:

    DIV {
        text-overflow-limit: 3ln;
        text-overflow-style: ellipsis;
    }

(Expanding is shown here just for additional clarity. Proposal itself is about _multiline_ texts.)

Given that original text is:

    Lorem ipsum dolor sit amet,
    consectetur adipiscing elit.
    Sed ac tempor diam. Suspendisse
    pellentesque ante eu turpis
    commodo vel elementum orci
    aliquam.

Resulting text for example CSS would be displayed next way:

    Lorem ipsum dolor sit amet,
    consectetur adipiscing elit.
    Sed ac tempor diam. Suspe...

Here, we have five-line text, but only three lines are displayed (text-overflow-limit: 3ln), and last line is clipped with ellipsis (text-overflow-style: ellipsis).

Once implemented, this would make text-overflow _much_ more useful and applicable on real-world sites than currently.

Thanks.

Received on Sunday, 15 January 2012 14:55:01 UTC