AI CSS Animations

Liquid Metal Text Effect

Silver letters with soft bright and dark reflections that slide and merge like mercury. Three radial blobs wander over a banded steel gradient, with a faint accent tint in the highlights.

Also known as: mercury text css, liquid chrome text, molten silver text.

Mercury

HTML

<div class="txt-liquid-metal-text">Mercury</div>

CSS

.txt-liquid-metal-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(circle closest-side, color-mix(in srgb, var(--c) 12%, #fff), transparent) 0% 30% / 45% 220% no-repeat,
    radial-gradient(circle closest-side, #1f2937, transparent) 100% 70% / 40% 220% no-repeat,
    radial-gradient(circle closest-side, #f8fafc, transparent) 50% 0% / 30% 220% no-repeat,
    linear-gradient(180deg, #d1d5db 0%, #f9fafb 30%, #6b7280 52%, #9ca3af 70%, #4b5563 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: max(1px, 0.012em) #6b7280;
  animation: txt-liquid-metal-text-flow 5s cubic-bezier(0.45, 0, 0.55, 1) infinite;}
@keyframes txt-liquid-metal-text-flow {
  0%, 100% { background-position: 0% 30%, 100% 70%, 50% 0%, 0 0; }
  33%      { background-position: 70% 80%, 20% 20%, 100% 60%, 0 0; }
  66%      { background-position: 100% 10%, 55% 90%, 0% 40%, 0 0; }
}

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