AI CSS Animations

Gradient Glow Text

A flowing gradient headline with a soft halo made of the same colors, so the glow changes hue under each letter as the colors travel. The halo is a blurred copy on the same keyframe.

Also known as: glowing gradient text css, gradient text with glow, colorful glow text.

Glow Up

HTML

<div class="txt-gradient-glow-text" data-text="Glow Up"><span>Glow Up</span></div>

CSS

.txt-gradient-glow-text {
  --c: var(--txt-color, #3b82f6);
  font-size: var(--txt-size, 32px);
  font-family: system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  position: relative;
  isolation: isolate;
  white-space: nowrap;
  font-weight: 800;}
.txt-gradient-glow-text::before,
.txt-gradient-glow-text span {
  background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 35%, #a855f7), color-mix(in srgb, var(--c) 30%, #ec4899), color-mix(in srgb, var(--c) 35%, #22d3ee), var(--c)) 0 0 / 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: txt-gradient-glow-text-flow 4s linear infinite;
}
.txt-gradient-glow-text::before {
  content: attr(data-text);
  content: attr(data-text) / "";
  position: absolute;
  inset: 0;
  z-index: -1;
  filter: blur(0.25em);
  opacity: 0.85;
}
@keyframes txt-gradient-glow-text-flow {
  to { background-position: 200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .txt-gradient-glow-text, .txt-gradient-glow-text *, .txt-gradient-glow-text::before, .txt-gradient-glow-text::after, .txt-gradient-glow-text *::before, .txt-gradient-glow-text *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

Customizing this snippet

  • Color: set --txt-color on the element or a parent. Currently previewing #3b82f6.
  • Font size: set --txt-size. Every other dimension is in em, so the whole thing scales together. Currently previewing 40px.
  • Speed: change the duration on the transition or animation shorthand. Staggered delays are relative, so they keep their rhythm.
  • Reduced motion: the rule at the end of the CSS turns the motion off for people who asked their OS for less of it. Keep it.

Similar text animations