in-between values

I had an idea for a special value that could be used with a variety of properties, for transitioning, animating, or just picking single values that are in between two values that don't normally have any mid-points. So for instance:

background-clip: mid(border-box, padding-box, 0.24) /* would clip 1/4 of the way from border-box to padding-box */

background-clip: mid(padding-box, border-box, 0.24) /* would clip 1/4 of the way from padding-box to border-box */

color: mid(transparent, blue, 0.7) /* equivalent to color:blue; opacity:0.7 */

color: mid(blue, transparent, 0.7) /* equivalent to color:blue; opacity:0.3 */

border-style: mid(dashed,solid,0.5) /* spaces between dashes are half their normal length */

border-style: mid(dashed,none,0.5) /* spaces between dashes are twice their normal length, and used border-width is half of specified value */

overflow: mid(visible, hidden, 0.5) /* overflow is visible, but semi-opaque */

This wouldn't work for everything, and we'd have to define what property values it did work for. New modules could define how it worked for their own values.

Received on Friday, 21 January 2011 17:55:07 UTC