-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Animations for slotted styles are ignored #4688
Comments
I think you're exactly right, it's a scope problem. The keyframes are defined inside the shadow DOM, and the slotted content is outside of it. To verify this, you can move the keyframes definition to the parent scope (in this case, I realize that's not a very satisfying answer, but styling slotted content is pretty limited. The other alternative to moving the keyframes out of the shadow DOM is to move the animation into shadow DOM. The simplest way to do this is to place the animation on http://plnkr.co/edit/bvEyIlcoE4Re6iQkUVro?p=preview Alternately, wrap the slot in a container element, like a |
I already moved the animation to the |
@lukeshiru Yeah, I'm not sure if this is just a platform bug, or a fundamental limitation of the spec. |
@arthurevans fwiw, using |
Same issue here. Suggested workaround don't seem to work when for applying animation based on attributes of the slotted content:
|
@govis I ended up applying the animation to the host ... the alternative solution is to wrap the |
I am trying to apply animations to the slotted content. My current workaround is to put |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still an issue guys. |
Cross-posting this here if it's helpful: https://codepen.io/castastrophe/pen/rNKjLVj?editors=0010 This shows defining the keyframe in the shadow DOM styles and referencing them on either ::slotted(*) or slot content. Appears to be working? Are there adjustments to the demo I can make to replicate the issue you were seeing? |
Could part of the issue be how the keyframe is defined? It's a CSSRule so it can't be nested inside a selector. i.e.,
Is not valid but:
would be valid. |
Great discussion the summary of which is that results vary by browser on whether or not a shadow DOM-defined keyframe can be applied to ::slotted or slot. Also variances in whether a light DOM-defined keyframe can be applied. |
Description
When an animation defined on the current element is applied in a
::slotted()
element, it's ignored. Maybe because of out of scope keyframes.Live Demo
http://plnkr.co/edit/uHlKBlQxmLSuoVmi1KYQ?p=preview
Steps to Reproduce
::slotted()
style block.Expected Results
The animation should play as expected (the keyframes should be in the scope of the slotted styles).
Actual Results
The animation is ignored.
Browsers Affected
Versions
The text was updated successfully, but these errors were encountered: