← All notes

CSS animations and the Web Animations API

Answer: CSS can set an animation sequence with keyframes, and the Web Animations API can write the same kind of motion in JavaScript.

Keyframes in CSS

A sequence can be a basic one-state animation or a more complex, time-based one.

Most animation tools use keyframes to pin states to timestamps on a timeline.

There is a specific point where each of these animation states start and end.

In CSS you map those points with keyframes, including from and to states.

The Web Animations API

The API lets developers write imperative animations with JavaScript.

Creating one should feel familiar if you have used keyframe rules.

The design underpins both CSS animation and transition implementations.

Existing effects can also be composed and timed.

First you need to create a Keyframe Object.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Google LLC, Animations; Google LLC, Web Animations API improvements in Chromium 84. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Google LLC, Animations; Google LLC, Web Animations API improvements in Chromium 84. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0.

Cite this

Permanent ID: iil:note:vncdv26w

iinventedlight. 2026. "CSS animations and the Web Animations API." iinventedlight Library, iil:note:vncdv26w, version of 2026-11-24. https://iinventedlight.com/library/notes/css-animations/. License: CC-BY-4.0.

@misc{iil_note_vncdv26w,
  author = {{iinventedlight}},
  title = {{CSS animations and the Web Animations API}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-24},
  url = {https://iinventedlight.com/library/notes/css-animations/},
  note = {Permanent ID iil:note:vncdv26w. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/css-animations.md.