Skip to content

[web-animations-2] Element.animate could allow keyframes to come from CSS declaration #2070

@birtles

Description

@birtles

From @dvoytenko on May 25, 2017 17:24

A proposal is to extend API to accept keyframes name from a CSS style. E.g.

<script>
  element.animate('anim1', {duration: 1000});
</script>
...
<style>
@keyframes anim1 {
  from {
    transform: translateX(200px);
  }
  to {
    transform: translateX(0px);
  }
}
</style>

This would be useful because CSS syntax still provides a better way to configure keyframes than a JSON object.

Copied from original issue: w3c/web-animations#189

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions