AI CSS Animations

Gradient Pulse Text

A white-hot glow blooms out from the middle of the word in a quick double beat, then fades back to the accent. The bloom is a radial gradient whose radius is a registered percentage.

Also known as: pulsing gradient text, radial gradient pulse css, color bloom text.

Live Now

HTML

<div class="txt-gradient-pulse-text">Live Now</div>

CSS

@property --txt-gradient-pulse-text-r {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}
.txt-gradient-pulse-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;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: radial-gradient(ellipse farthest-side at 50% 50%,
    color-mix(in srgb, var(--c) 40%, #fff) 0%,
    color-mix(in srgb, var(--c) 65%, #fff) calc(var(--txt-gradient-pulse-text-r) * 0.5),
    var(--c) var(--txt-gradient-pulse-text-r));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: txt-gradient-pulse-text-beat 1.8s ease-out infinite;}
@keyframes txt-gradient-pulse-text-beat {
  0%       { --txt-gradient-pulse-text-r: 0%; }
  12%      { --txt-gradient-pulse-text-r: 70%; }
  22%      { --txt-gradient-pulse-text-r: 40%; }
  36%      { --txt-gradient-pulse-text-r: 110%; }
  80%, 100% { --txt-gradient-pulse-text-r: 0%; }
}

@media (prefers-reduced-motion: reduce) {
  .txt-gradient-pulse-text, .txt-gradient-pulse-text *, .txt-gradient-pulse-text::before, .txt-gradient-pulse-text::after, .txt-gradient-pulse-text *::before, .txt-gradient-pulse-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