W3C home > Mailing lists > Public > www-style@w3.org > April 2012

Re: [css3-animations] Change to currentColor means it's no longer animatable?

From: Shane Stephens <shans@google.com>
Date: Tue, 1 May 2012 08:31:17 +1000
Message-ID: <CAGTfzwR8LiORBkJwmiAeLvf9wH5Mq1_fJBtTRKfkac5DCt_tmw@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-style list <www-style@w3.org>
On Tue, May 1, 2012 at 5:37 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:

> [A w3c-style discussion accidentally turned technical. I'm moving it
> to www-style.]
>
> For a few reasons, we're changing the definition of currentColor to
> resolve to a definite color at used-value time rather than
> computed-value time.
> <http://lists.w3.org/Archives/Public/www-style/2012Jan/0521.html>
> <http://lists.w3.org/Archives/Public/www-style/2012Jan/0936.html>
>
> This changes the behavior of currentColor and Transitions.
> Previously, if you had a set up like:
>
> p {
>  color: red;
>  border-color: currentColor;
>  transition: 1s border-color;
> }
> p:hover {
>  color: blue;
> }
>
> ...you would transition the border-color when you hover the element,
> since at computed-value time (the point that transitions look at) it
> was "red" or "blue", not "currentColor".
>
> With this change, though, this would no longer occur, since the
> border-color's computed value would be "currentColor" regardless.
>
> Is this acceptable?  Or should we make an exception for currentColor
> and transition it?  Conceptually, currentColor is still a
> computed-time value - it doesn't require any layout information to
> figure out.  We're only moving it to used-time so that it has better
> inheritance behavior in some situations.
>

Failing to display a transition seems suboptimal. An exception would be
better - and there is a precedent :)

We already make an exception for animating gradient stops - these actually
can't be calculated until used-time due to the need to know the size of the
container.

Cheers,
    -Shane


>
> ~TJ
>
>
Received on Monday, 30 April 2012 22:31:47 GMT

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