W3C home > Mailing lists > Public > www-style@w3.org > July 2005

Re: Dimensions better than unitless numbers for future CSS specs

From: Etan Wexler <ewexler@stickdog.com>
Date: Sat, 09 Jul 2005 15:08:19 -0400
Message-ID: <42D020A3.1050709@stickdog.com>
To: CSS specification-development list <www-style@w3.org>

Laurens Holst wrote to the CSS specification-development list
<mailto:www-style@w3.org> on 7 July 2005 in “Re: Dimensions better than
unitless numbers for future CSS specs”

> How is a unitless number for an addition different from using a unitless 
> number for a multiplication (as is the case with line-height, and would 
> be with word-spacing)?

The case of 'line-height' is special. A 'line-height' value of a
unitless number implies typographical muttons. But using the CSS 'em'
dimension, the usual CSS way to represent typographical muttons, carries
a particular semantics for inheritance. The alternative, I suppose,
would have been the creation of a new unit, say, 'heritable-em' or 'hem'.

A 'heritable-em'/'hem' unit is a reasonable idea. Such a unit would work
well with properties like 'word-spacing':

     <T-1 style="font-size: 8pt; word-spacing: 0.1hem">
         <T-2 style="font-size: 2em">
             Word spacing here is
             the sum of 1.6pt and
             any one of the normal
             values for the used
             fonts at 16pt.

If 'word-spacing' were to permit unitless-number values, why should the
implied unit be the normal word spacing instead of heritable em?

> That’s the whole idea of unitless numbers, they are used for pure 
> mathematical operations where a unit is not appliccable.

In the cases under discussion, units are applicable. An image rendered
at 0.75 times its intrinsic width still has a rendered width that one
can measure in millimeters.

> After all, if you have 5 times 1 meter, you don’t say "1m x 5m",
> but you say "1m x 5".

And if one has 5 times normal word spacing, I do not suggest writing
{1norm * 5norm}. While we could introduce a construct such as {1norm *
5}, the idiomatic CSS would be the simple {5norm}.

Etan Wexler.
Received on Saturday, 9 July 2005 19:05:18 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:19 UTC