W3C home > Mailing lists > Public > www-style@w3.org > February 2011

Re: in-between values

From: timeless <timeless@gmail.com>
Date: Tue, 1 Feb 2011 13:25:50 +0200
Message-ID: <AANLkTikKBdTGGQ5aaaOO0gwkutCnd+FU6DZM+=mNYGiG@mail.gmail.com>
To: Brad Kemper <brad.kemper@gmail.com>
Cc: www-style list <www-style@w3.org>
On Fri, Jan 21, 2011 at 7:54 PM, Brad Kemper <brad.kemper@gmail.com> wrote:
> 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 */

Isn't 1/4 usually 0.25? Why did you write 0.24, is there some magic going on?

> 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 */

It took me a couple of readings to understand this. You aren't using
mid to mean 'midpoint'...

A graphic here would have helped.

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

fwiw, the other mid that comes to mind is:
MID$(stringexpression$, start, length)

Which obviously doesn't behave the way you're using it here. I've had
a hard enough time trying to describe this to myself that i expect
people will mess this up while trying to use it. -- I really don't
like the name.

We already will have calc() and eventually css variables, do we need
another thing here? if we gave calc() the ability to operate on colors
(and other things), would that work?

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

What would be the result for border-style: mid(double, dashed, 0.6)

could i do border-style: mid(groove, mid(double, dashed, 0.4), 0.7) ?
Received on Tuesday, 1 February 2011 11:26:22 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:37 GMT