SyntaxStudy
Sign Up
CSS Intermediate 4 min read

Animating Gradients

Gradient Animations

Gradients cannot be transitioned directly, but you can animate background-position or use CSS variables to create movement.

Example
.shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
Pro Tip

The shimmer/skeleton-loading pattern uses animated gradient background-position.