Re: [css3-animations] Override of animation rule by !important

On Fri, 20 Jan 2012 01:01:51 +0100, Sylvain Galineau  
<sylvaing@microsoft.com> wrote:

> We resolved during the 1/4 telcon [1] to allow !important user rules to  
> override
> animations.
>
> While this seems reasonable and coherent with the overall CSS model, we  
> need
> to understand what it means in scenarios such as:
>
>  @keyframes colorChange {
>        from { color: red; }
>             to { color: blue; }
>  }
>  div {
>   animation: colorChange 4s infinite alternate;
>   transition: color 1s;
>  }
>
> /* user stylesheet */
> div:hover { color: green !important; }
>
>
> Obviously the fun part is when the :hover rule matches during the  
> animation.
>
> - Does the :hover transition starts from whatever intermediate value was  
> last
> applied by colorChange?

I'm not sure, but presumably it should act the same as if the animation  
were removed while in progress. If there is a transition, it should  
probably start from the intermediate value. But maybe there shouldn't be a  
transition at all.

> - What happens when the user hovers away? Transitioning back to a moving  
> target
> is not easy nor is it clearly desirable. Nor would a reversal look  
> appropriate.

The current Transitions draft says that "[i]mplementations must not start  
a transition when the computed value of a property changes as a result of  
declarative animation". This seems like such a case, though I think that  
sentence could use some clarification. (If the property's "computed value"  
changes due to an animation finishing or being aborted, like in the  
previous question, does that count as a "result of declarative animation"?)

See also <http://lists.w3.org/Archives/Public/www-style/2011Nov/0071.html>.

> [1] http://lists.w3.org/Archives/Public/www-style/2012Jan/0099.html


-- 
Øyvind Stenhaug
Core Norway, Opera Software ASA

Received on Friday, 20 January 2012 15:46:01 UTC