Unit 5 — Animation Practice

Modern CSS Features

A curated collection of the CSS features that have reshaped how we build for the web, from container queries to cascade layers to scroll-driven animations.

Layout features

Layout Has Grown Up

Grid and Flexbox solved the hard problems of page and component layout years ago, but container queries and subgrid fill in the gaps that remained. Components can now adapt to their context without any knowledge of the page they live in.

Cascade layers complement this by giving you explicit control over specificity, so your design system, third-party styles, and utility overrides all coexist without conflict.

Color features

Color Is More Expressive

The move to perceptually uniform color spaces like oklch means that generating a color palette programmatically actually looks right. Every step in lightness reads as the same visual distance to the human eye.

Functions like color-mix() and light-dark() bring logic directly into CSS that previously required a build tool or multiple media query blocks to express.

Animation features

Animation Without JavaScript

Scroll-linked animations used to mean attaching a scroll event listener, calculating offsets on every frame, and hoping the main thread was free. Scroll-driven animations replace all of that with two CSS properties.

The View Transitions API handles the JavaScript side of animated state changes, leaving CSS to define how the transition looks via the ::view-transition-old and ::view-transition-new pseudo-elements.

Typography features

Typography Details Matter

Small typographic improvements like text-wrap: balance are the kind of polish that designers have always wanted but had to fake with manual line breaks or JavaScript. Now a single property handles it automatically.

Variable fonts and font-size-adjust address performance and consistency concerns that were previously impossible to solve purely in CSS, removing another category of JavaScript workarounds entirely.