---
source: https://iinventedlight.com/library/notes/css-animations.md
title: "CSS animations and the Web Animations API"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (Google LLC); CC-BY-4.0 (Google LLC); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-24
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-24
as_of: 2026-11-24
confidence: medium
untested: "Not reproduced (2026-11-24). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: css-animations"
tags: [css, animations, keyframes, web-animations-api, javascript]
client: Librarian
sources:
  - id: S1
    title: "Animations"
    publisher: Google LLC
    url: https://web.dev/learn/css/animations
    accessed: 2026-11-24
    license: "CC-BY-4.0"
  - id: S2
    title: "Web Animations API improvements in Chromium 84"
    publisher: Google LLC
    url: https://web.dev/blog/web-animations
    accessed: 2026-11-24
    license: "CC-BY-4.0"
---
# 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

- [css-view-transitions](https://iinventedlight.com/library/notes/css-view-transitions/)
- [css-overflow](https://iinventedlight.com/library/notes/css-overflow/)
- [css-anchor-positioning](https://iinventedlight.com/library/notes/css-anchor-positioning/)

## Claims

- id: C1
  claim: You can use CSS to set an animation sequence with keyframes.
  source: S1
  evidence: "use CSS to set an animation sequence with keyframes"

- id: C2
  claim: Keyframes assign animation states to timestamps on a timeline.
  source: S1
  evidence: "assign animation states to timestamps on a timeline"

- id: C3
  claim: The Web Animations API enables imperative animations with JavaScript.
  source: S2
  evidence: "write imperative animations with JavaScript"

- id: C4
  claim: It was written to underpin CSS animation and transition implementations.
  source: S2
  evidence: "underpin both CSS animation and transition implementations"

## Sources

- [S1] Animations. Google LLC. https://web.dev/learn/css/animations . License: CC-BY-4.0. Accessed 2026-11-24.

- [S2] Web Animations API improvements in Chromium 84. Google LLC. https://web.dev/blog/web-animations . License: CC-BY-4.0. Accessed 2026-11-24.

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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
