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

Re: Syntax for Ranges?

From: Kelly Miller <lightsolphoenix@gmail.com>
Date: Sun, 30 Oct 2005 18:53:07 -0500
Message-ID: <43655CE3.4060605@gmail.com>
To: Ben Ward <benmward@gmail.com>
CC: Lachlan Hunt <lachlan.hunt@lachy.id.au>, www-style@w3.org

Ben Ward wrote:

>
>I was thinking much the same. I like the idea of having min/max
>properties condensed into one, certainly with there being a number of
>voices about the web asking for min/max margins and paddings.
>
>Is there a problem if we simply add a third parameter as follows?
>
>| height: range(initial, min, max);
>
>Using the word 'initial' is of course less than ideal since it's used
>elsewhere in CSS, but for sake of this rough example I hope that's OK
>;-)
>
>Ben
>http://ben-ward.co.uk
>
>  
>
Try this:

range(30em) - 30em or more (auto)
range(,30em) - 30em or less (auto)
range(15em, 30em) - between 15em and 30em (auto)
range(15em,20%,) - if the derived height (20% of whatever, based on the 
cascade) is less than 15em, then 15em.  Else use 20%.
range(,20%,30em) - if the derived height is greater than 30em, then use 
30em.  Else use 20%.
range(15em,20%,30em) - if the derived height is less than 15em, then use 
15em.  Else if the derived height is greater than 30em, then use 30em.  
Else use 20%.

Defaults are either 0 or -32768 (depending on whether negative numbers 
make sense or not) for min, 32768 or 65535 for max, and auto or 0 for 
the relative entry (meaning that if the user doesn't enter anything for 
the relative entry, and auto doesn't make sense, it's assumed that use 
of range is probably an error; or the user meant to enter a relative 
entry and just forgot, in which case the entry will act oddly and the 
error will be noticed).

Also, the centre number CAN be an absolute entry...but range(30em,20px,) 
= 20px, so I dunno why you would want to (also why I didn't bother 
having a range(,20%,); that's the same as just 20%).

-- 
http://www.mozilla.org/products/firefox/ - Get Firefox!
http://www.mozilla.org/products/thunderbird/ - Reclaim Your Inbox!

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
Received on Sunday, 30 October 2005 23:53:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:41 GMT