Skip to content
Guest
Learn CSS · Course Syllabus Show lessons
Visual Polish & Motion · 8 min read · Beginner

Transitions & GPU-Friendly Transforms

Create silky 60fps micro-interactions by transitioning transform and opacity with smooth cubic-bezier easing.

What you'll learn

  • Animate hover and focus states smoothly with transition
  • Use translate, scale, and rotate transforms without triggering expensive layout reflows
  • Keep interactions snappy (150ms–250ms) and responsive

Subtle transitions give buttons and cards tactile feedback. To keep animations at a buttery 60fps even on budget phones, stick to compositor-only properties: transform and opacity.

✓ Animate transform & opacity (Fast)
.card {
transition: transform 200ms ease, box-shadow 200ms ease;
}
.card:hover {
transform: translateY(-4px);
}
✕ Avoid Animating Layout Properties
/* Triggers layout recalculation every frame! */
.card {
transition: all 200ms ease;
}
.card:hover {
margin-top: -4px;
}

Avoid transition: all, explicitly listing the properties you animate prevents accidental jank.

Fill-in-the-Blank Exercise

Snappy Button Lift

Transition transform over 180ms and lift the button upward by 2px on hover.

.btn {
: transform 180ms ease;
}
.btn:hover {
transform: (-2px);
}

Try It Yourself

Hover over the cards below to feel the smooth translateY + scale micro-interaction:

Interactive Card Hover Transitions
Live Result

Check Your Understanding

Score: 0 / 1

1. Which two CSS properties are cheapest for the browser to animate at 60fps?

Study Workspace

Finished this lesson?

Your progress is saved locally in your browser, no account needed.

Search courses, lessons, and references

Type to search across all courses, lessons, and quick references.

Press Esc to close Powered by Pagefind