[css3-text] better way to do forced last-line justification

The CSS3 Text spec includes a new 'text-align-last' property for
controlling alignment on the last line of a paragraph for example. [1]
There isn't an example in the spec, but I'm guessing the use case is
something like this:

  p {
    text-align: justify;
    text-align-last: left;

This way if the last line contains just two words they aren't spread
across the page.

But using a new property for this seems like overkill, there seem to
be lots of combinations that have no real use case.

  p {
    text-align: justify;
    text-align-last: center;

I think it might be better to add an additional keyword to the
'text-align' property instead.  Since forcing full justification on
the last line is rarely desirable, I would propose a 'force-last'
keyword that explicitly forces full justification on the last line:

  p {
    text-align: justify force-end;

Without the keyword, last line alignment would be based on the
direction.  This seems like a more natural way of spec'ing this.


John Daggett

[1] http://dev.w3.org/csswg/css3-text/#text-align-last

Received on Wednesday, 28 November 2012 07:16:02 UTC