Six ways to put gradients on text with Tailwind: a gradient headline, one gradient word in a white heading, an animated shine, a conic colour wheel, a gradient underline under a phrase and dashboard numbers with a metallic fade.
Gradient text in four utilities: bg-gradient-to-r with from- and to- colours, bg-clip-text and text-transparent. Both stops are dark enough to keep the heading above 4.5:1 contrast on white.
Only one word in a white headline gets the gradient, by wrapping it in a span with the clip utilities. A via- stop adds a third colour, and the light pastel stops stay readable on a dark background.
A gradient three times wider than the word slides through the letters. bg-[length:300%_100%] sizes the background, one keyframe moves its position, and motion-reduce:animate-none keeps it still for anyone who asks.
@keyframes twtx-shine { to { background-position: 300% 0; } }
04. Tailwind Conic Gradient Text
TailwindGradient textConic
A colour wheel clipped to the letters with an arbitrary conic-gradient background. Moving the centre with at 50% 60% changes which hue lands on which letter.
Instead of colouring the letters, a thick gradient bar sits under the key phrase, drawn as a background sized to 100% by 8px at the bottom. The text keeps its normal colour, so contrast is never in question.
Big dashboard numbers that fade from white to slate from top to bottom, giving them a metallic finish. Each figure is a description list value paired with its label, which flex-col-reverse shows underneath.