@apply do not apply in @keyframes |
||||||||
Issue descriptionVersion: Version 54.0.2827.0 canary (64-bit) OS: OS X 10.11.6 What steps will reproduce the problem? (0) Enable Experimental Web Platform Features flag (1) Load http://jsbin.com/repeqoy/edit?html,output (2) Wait 1s for animation to finish (3) Observe position of red and green bars What is the expected output? The red and green bars should animate to the same position, left 200px. What do you see instead? Only the green bar animates by 200px. The red bar animates by only 100px. The green bar sets the `left` distance with a variable, and the red bar uses a mixin. Please use labels and text to provide additional information.
,
Aug 16 2016
,
Aug 17 2016
Tab, can you confirm whether this is supposed to work or not.
,
Aug 17 2016
I just talked with Shane about this. The original intention of the spec was that this was not allowed - @apply was only supposed to be useful in style rules (same as var()). However, apparently Firefox applies var() in @keyframes (based on the element that the animation is applied to), so we could run @apply the same way. Plan is to bring this up at the TPAC meeting and decide one way or another.
,
Aug 17 2016
FWIW, Chrome also applies var() in @keyframes, which I certainly hope continues to be the case. It feels very natural to use var() and @apply in @keyframes and @media, and it seems odd that the spec would disallow that usage.
,
Aug 18 2016
Well, it's that there's no element context in the @keyframes rule itself to draw the values from. It obtains a context only when specified in the context of a given animation. I hadn't intended to rely on that, but it does seem useful, so I'm okay with adding it. @apply is more complicated, so Shane and I will discuss and hash out the issues, but I'm optimistic that it'll work fine.
,
Aug 18 2016
,
Feb 12 2017
Are we still planning to do @apply?
,
Feb 21 2017
Our current plan of record is no; we're instead going to try and do ::part(), pending agreement from the other vendors.
,
Mar 8 2017
so there was no solution found for @apply? :/ For me personally @apply worked pretty great even just with the webcomponents polyfill :) will ::part() be a full replacement? is there a polyfill? could someone point me to more information? I could not find any?
,
Mar 8 2017
This bug is basically one of the problems with @apply that we got stuck on. Defining a consistent (and intuitive) order for @apply, variable substitution, animation/transition construction, and animation application to work in turns out to be incredibly hard. From memory, ::part() doesn't have this problem as it doesn't add an extra contribution to the stack of things to do on style resolution. In other respects, however, it's roughly as powerful, particularly when coupled with ::theme(). I believe @9 has a writeup somewhere.
,
Mar 8 2017
I see - thx for explaining it in more detail :) any info regarding ::part() or ::theme() would be nice :)
,
Apr 11 2017
,
Apr 21 2017
for anyone else who stumbles on this - here is the writeup of the general idea as far as I can see http://tabatkins.github.io/specs/css-shadow-parts/ https://github.com/tabatkins/specs PS as noted there: "This spec is not yet ready for implementation. It exists in this repository to record the ideas and promote discussion."
,
Dec 6 2017
,
Jan 30 2018
|
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by dfreedm@chromium.org
, Aug 12 2016