Re: Dimensions better than unitless numbers for future CSS specs

Etan Wexler wrote:

>> 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'.

Isn’t that just a percentage? Line-height: 110%? A 0...100% percentage 
is exactly the same as 0...1, except that percentages do have a suffix 
(but not a unit). So that would equal line-height: 1.1. Everywhere 
percentages are used, a number between zero and one could also be used, 
and vice versa. At least, theoretically, but not in the CSS specification.

Such numbers without unit inherently *have* to work on an inherited 
dimension because they are not a dimension itself. If they would not, 
they wouldn’t mean anything, so it makes sense if you view it that way. 
And if you think percentages are logical, e.g. width: 50%, then from a 
mathematical point of view that makes exactly as much sense as width: 0.5...

A ‘hem’ is not desirable because, again, it is a multiplication factor 
and not locked in to a certain unit...

But I do think CSS is quite inconsistent in this respect, also consider 
rgba(80%,80%,80%,0.8), and I wonder what the rationale for that is. I’m 
not a star mathematician, so I might have missed something... :)


~Grauw

-- 
Ushiko-san! Kimi wa doushite, Ushiko-san!!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Laurens Holst, student, university of Utrecht, the Netherlands.
Website: www.grauw.nl. Backbase employee; www.backbase.com.

Received on Saturday, 9 July 2005 19:18:45 UTC