Typography · 20 of 33

Gradient Sweep

Animated gradient flows across the text

HTML · CSS · No dependencies · MIT

HTML

<p class="gradient-sweep-headline">Sweep</p>

CSS

.gradient-sweep-headline {
  font-size: 3.5rem;
  font-weight: 600;
  text-align: center;
  background: linear-gradient(90deg, #f0f0f5, #7c5cff, #a78bfa, #f0f0f5);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-sweep 4s linear infinite;
}

@keyframes gradient-sweep {
  from { background-position: 0% 50%; }
  to { background-position: 300% 50%; }
}