New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 637419 link

Starred by 4 users

Issue metadata

Status: ExternalDependency
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 586974



Sign in to add a comment

@apply do not apply in @keyframes

Project Member Reported by dfreedm@chromium.org, Aug 12 2016

Issue description

Version: 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.

 
Cc: timloh@chromium.org
Cc: -timloh@chromium.org
Labels: -Pri-3 Pri-2
Owner: timloh@chromium.org
Status: Assigned (was: Untriaged)

Comment 3 by timloh@chromium.org, Aug 17 2016

Cc: timloh@chromium.org
Owner: tabatkins@chromium.org
Tab, can you confirm whether this is supposed to work or not.
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.
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.
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.
Blocking: 586974
Labels: Update-Quarterly
Are we still planning to do @apply?
Our current plan of record is no; we're instead going to try and do ::part(), pending agreement from the other vendors.

Comment 10 by d4k...@gmail.com, 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?
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.

Comment 12 by d4k...@gmail.com, Mar 8 2017

I see - thx for explaining it in more detail :)
any info regarding ::part() or ::theme() would be nice :)

Comment 13 by shend@chromium.org, Apr 11 2017

Labels: Hotlist-Interop

Comment 14 by d4k...@gmail.com, 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."
Labels: -Update-Quarterly

Comment 16 by e...@chromium.org, Jan 30 2018

Cc: tabatkins@chromium.org
Owner: ----
Status: ExternalDependency (was: Assigned)

Sign in to add a comment