Menu

1 / 5

Keyframes Tokens: Standardizing Animation Across Projects — Smashing Magazine

Smashing Magazine·Amit Sheen·7 months ago
#aOyz8i
#css#animation#techniques#keyframes#pulse
Reading 0:00
15s threshold

24 min read

CSS , Animation , Techniques

Animations can be one of the most joyful parts of building interfaces, but without structure, they can also become one of the biggest sources of frustration. By consolidating and standardizing keyframes, you take something that is usually messy and hard to manage and turn it into a clear, predictable system.

Picture this: you join a new project, dive into the codebase, and within the first few hours, you discover something frustratingly familiar. Scattered throughout the stylesheets, you find multiple @keyframes definitions for the same basic animations. Three different fade-in effects, two or three slide variations, a handful of zoom animations, and at least two different spin animations because, well, why not?

@keyframes pulse { from { scale: 1; } to { scale: 1.1; } }

@keyframes bigger-pulse { 0%, 20%, 100% { scale: 1; } 10%, 40% { scale: 1.2; } }

If this scenario sounds familiar, you’re not alone.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.