Gradient Text — .mv-gradient-text

Pure-CSS multi-color gradient text: static, animated back and forth, editorial fade, or an aurora of colored blobs drifting inside the letters.

CategoryAnimated text
TypeCSS only (.mv-gradient-text)
Statusstable
Keywordsgradient, aurora, heading, colorful, hero, background-clip

When to use

Avoid when

Install

node scripts/add.mjs gradient-text --out ./src/marvelous

AI agent with the Marvelous UI MCP server: install_components({ slugs: ["gradient-text"], target_dir: "<absolute path>/src/marvelous", framework: "react" }).

Files copied (dependencies included): tokens/tokens.css, core/base.css, components/gradient-text/gradient-text.css.

Usage

Canonical markup — start from it and customize with attributes, data-* and CSS variables:

<div style="display:grid;gap:1.6rem;justify-items:center;text-align:center;max-width:44rem">
  <h2 style="margin:0;font:800 clamp(2rem,5vw,3.2rem)/1.05 var(--mv-font-sans);letter-spacing:-.04em">
    Interfaces that <span class="mv-gradient-text" data-animate>captivate</span>.
  </h2>

  <p style="margin:0;font:800 clamp(2.4rem,6vw,4rem)/1 var(--mv-font-sans);letter-spacing:-.05em">
    <span class="mv-gradient-text" data-variant="aurora">Imagine without limits</span>
  </p>

  <h3 class="mv-gradient-text" data-variant="fade" style="margin:0;font:700 clamp(1.5rem,3.5vw,2.2rem)/1.15 var(--mv-font-sans);letter-spacing:-.03em">
    The design system for your whole team
  </h3>

  <div style="display:flex;gap:2.5rem;flex-wrap:wrap;justify-content:center">
    <div>
      <div class="mv-gradient-text" data-animate data-glow style="--mv-gradient-text-colors:#22d3ee,#a78bfa,#f472b6;--mv-gradient-text-glow:#a78bfa;font:800 2.4rem/1 var(--mv-font-sans);letter-spacing:-.03em">+38%</div>
      <div style="font-size:.8rem;color:var(--mv-fg-muted);margin-top:.35rem">conversions</div>
    </div>
    <div>
      <div class="mv-gradient-text" data-animate="y" style="--mv-gradient-text-colors:var(--mv-success),var(--mv-info),var(--mv-success);font:800 2.4rem/1 var(--mv-font-sans);letter-spacing:-.03em">99.99%</div>
      <div style="font-size:.8rem;color:var(--mv-fg-muted);margin-top:.35rem">uptime</div>
    </div>
  </div>
</div>

API

Attributes

NameTypeDescription
data-animate(empty) | y | hoverAnimates the gradient horizontally, vertically, or only on hover.
data-variantfade | aurorafade: a heading that fades out toward the bottom; aurora: blurry blobs in motion (--mv-gradient-text-c1…c4).
data-glowbooleanGlowing halo around the letters.

CSS classes

NameDescription
mv-gradient-textOn a heading or a span. When text wraps, each line gets its own gradient.

CSS variables

NameDefaultDescription
--mv-gradient-text-colorsaccent, pink, amberComma-separated list of colors (stop positions accepted).
--mv-gradient-text-angle90degGradient angle.
--mv-gradient-text-duration6s (aurora: 10s)Duration of one pass.
--mv-gradient-text-c1 … c4accent, pink, warning, infoBlob colors of the aurora variant.
--mv-gradient-text-glowvar(--mv-accent)Halo color (data-glow).

Accessibility

Real text, selectable and read normally. Pick colors that contrast with the background: the lightest one determines legibility. Reduced motion: static gradient.