liveBook · Manning

Chapter 15: Transitions

What you will learn in chapter 15 of CSS in Depth, Second Edition

Introduces CSS transitions as a way to make value changes feel smooth and draw attention to changes on a page.

After this chapter you will be able to

What it builds on

Section by section

Introduction

Introduces CSS transitions as a way to make value changes feel smooth and draw attention to changes on a page.

Key terms: CSS transition, ease, hover state, transitions, motion

15.1 From here to there

This section explains how CSS transitions respond to property changes, how to configure them, and how to respect a user’s reduced-motion preference.

Key terms: transition-*, :hover, property value, transition-* properties, transitioning in, transitioning out, transition-property, all, transition-duration, seconds

15.2 Timing functions

This section explains how timing functions control the rate of change during a CSS transition and uses a hover demo to compare them.

Key terms: timing function, linear, ease-in, ease-out, transition, left property, absolutely positioning, performance

15.2.1 Custom Bézier curves

This section explains how Bézier curves control transition timing, how to create a custom curve, and how to choose timing functions for different interactions.

Key terms: Bézier curves, timing functions, linear, acceleration, deceleration, control points, handles, cubic-bezier(), DevTools, decelerating

15.2.2 Steps

This subsection explains how CSS steps() timing functions make a transition jump between discrete values instead of changing smoothly.

Key terms: steps(), start, end, transition duration

15.3 Non-animatable properties

This section uses a dropdown menu to introduce simple transitions on property changes and gives practical guidance on transition duration before developing the menu’s effects.

Key terms: transition, transition property, hover, open and closed states, transition duration, hover effects, fades

15.3.1 Properties that cannot be animated

This section explains why some CSS properties cannot be smoothly transitioned and how to check a property’s animation type.

Key terms: interpolated, discrete, display, background-color, opacity, MDN, Formal Definition, Animation Type

15.3.2 Fading in and out

This subsection shows how to fade a menu in and out while ensuring its transparent, closed state does not block clicks on links behind it.

Key terms: opacity, fully transparent, visibility, display, transition-delay, document flow, absolute positioning, transition delay, fade-in, fade-out

15.4 Transitioning to auto height

This section explains why a dropdown cannot transition directly between zero height and auto height, then uses JavaScript to supply a measured height while CSS handles the animation.

Key terms: height, auto, overflow, scrollHeight, is-open class, CSS, JavaScript, easing

15.5 Transitioning custom properties

This section explains how registering a custom property with @property lets the browser transition its values and validate them against a declared syntax.

Key terms: custom property, @property, data type, interpolate, syntax, inherits, initial value, type safety, |, +

15.6 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 14: Masks, shapes, and clipping Chapter 16: Transforms →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.