Re: [csswg-drafts] [web-animations-2] Element.animate could allow keyframes to come from CSS declaration (#2070)

I think this proposal would be a great way for authors to easily implement their effects in CSS and then reuse it via WAAPI.
This would be great for library authors, but also for  developers who have their own library of effects which they want to reuse in WAAPI. So IMO this will greatly simplify usage of WAAPI.

I propose we allow the above suggested API:

```js
Element.animate(keyframes: string, options?: number | KeyframeAnimationOptions)
```

And also for `KeyframeEffect`'s:

```js
new KeyframeEffect(target: Element, keyframes: string, options?: number | KeyframeAnimationOptions)
```

@birtles @flackr @bramus thoughts? 

-- 
GitHub Notification of comment by ydaniv
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2070#issuecomment-2721926710 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 13 March 2025 16:37:28 UTC