Re: Syntax for Ranges?

Anne van Kesteren wrote:
> 
> Quoting Lachlan Hunt <lachlan.hunt@lachy.id.au>:
>>> height: range(18px,30em) - No smaller than 18px, no larger than 30em.
>>
>> So, what height would it be?  Any random height between 18px and 30em?
> 
> I guess the same as what would happen with:
> 
> min-height:18px; max-height:30em

Perhaps, assuming height: auto; as well, in which case the result is 
already well defined.  But there would need to be a 3rd value in the 
range() function, as suggested by Ben Ward, for the cases where it's not 
'auto'.

>> min(), max() and calc() functions have all been suggested previously 
>> and make a lot more sense than this.
> 
> Those are not the same.

They're not the same, but could possibly be used to the same effect.
eg.
   height: min(30em, max(18px, 50%) );

That is theoretically equivalent to:
   min-height:18px; max-height:30em; height: 50%;

-- 
Lachlan Hunt
http://lachy.id.au/

Received on Saturday, 29 October 2005 13:43:54 UTC