Pseudo element animations doesn't work in Safari and iOS

Viewed 336

I'm using web components in a shadow dom, and all animations work fine in Chrome. However, in Safari and thus iOS Safari, the animations on elements work fine, but not on pseudo elements. This baffles me, because it's ONLY on pseudo elements like :after and :before.

There is nothing wrong with the code, because when I run it without a shadow dom everything triggers just fine and works perfectly in all browsers.

Why is this, and how can I remedy this problem?

  • I've tried setting important on the animation css, didn't work.
  • Tried moving @keyframes higher up in the shadow dom, didn't work.
  • Tried including the @keyframes in the document that includes the shadow dom, this worked.

However, I'd prefer not to solve it like this because then I have to include a shared animation css asset in both the main document and the document that is meant to be included via shadow dom. And it's still weird that the normal animations work, but not pseudo elements. The pseudo elements are there, the ONLY thing lacking is that the animation doens't trigger.

0 Answers
Related