A gradient hero looks great in the design file. The headline sits across a smooth blend and the colors feel modern. Then the page ships, real visitors read it on real screens, and the second half of the headline is a struggle: the words fade into the light end of the blend until people squint or give up.

Text on a flat color is a simple contrast question with one answer. Text on a gradient is the same question asked at every point the letters cross, and the blend only has to fail at one of them. This guide walks through the mistakes that cause those failures, using the free CSS Gradient Generator on Ovatly, and shows the one check that tells you the truth before you ship.

Contents

  • Quick answer
  • Why a gradient is harder on text than a flat color
  • The three failure patterns
  • How to check a gradient before you ship it, step by step
  • Worked example: white text on the blue pair
  • Limitations and honest tradeoffs
  • Common mistakes
  • FAQs
  • Conclusion
  • References

Quick answer

Text over a gradient fails when any shade under the letters is too close to the text color. The usual causes are two mid-tone stops that give neither white nor dark text a safe end, a busy multi-stop blend behind copy, and white text placed over a gradient that ends light. Build the gradient in the CSS Gradient Generator, copy the declaration into your page, put your real text on top, and read both ends of the blend at the real size. The generator has no contrast checker, so that read-through is the test.

Why a gradient is harder on text than a flat color

On a flat background, every letter sits on the same color. If the contrast works, it works for the whole block of text, and you can judge it in one glance.

A gradient is a range of colors pretending to be one background. A headline set across it might start on a deep shade, pass through two middle shades, and finish on a pale one. The reader's eye does not average those shades out. It reads letter by letter, and each letter gets the contrast of the exact shade behind it. A blend that looks balanced as a whole can still contain a stretch where the text nearly vanishes.

Small text suffers first: the thin strokes of body copy and captions give up long before the thick strokes of a display headline do.

The three failure patterns

Two mid-tone colors. This is the classic. Neither stop is dark and neither is light, so white text is weak against both ends and dark text is weak against both ends too. The blend looks tasteful on its own, and there is no safe shade anywhere under the text.

A busy blend behind copy. The generator allows up to six stops, and every stop is another shade the text must survive. Three or four shifting hues behind a paragraph means the contrast changes line by line, and somewhere in that range it will dip. Decorative panels can carry busy blends. Text cannot.

White text over a light ending. White headlines are the default over gradients, so they get placed without a second thought. If the blend travels toward a light color, the text near that end washes out, even when it reads perfectly at the dark end.

How to check a gradient before you ship it, step by step

  1. Open the CSS Gradient Generator and build your gradient: pick the type, set the angle, and set your stops. Start with two stops when text will sit on top.
  2. Copy the single background declaration the tool produces.
  3. Paste it into your page or stylesheet, on the real element, with your real headline and body copy on top of it.
  4. Read the text at both ends of the blend and at the size it will ship, including the smallest text that sits on the gradient.
  5. If any stretch fails, adjust one stop at a time in the generator, copy the new declaration, and read again. Deepen the light end for white text, or lighten the dark end for dark text.
  6. Check again on a phone-sized viewport if the element changes shape, because the blend redistributes across the new box.

Worked example: white text on the blue pair

Take the generator's own example: a linear gradient at 135deg from #0ea5e9 at 0% to #2563eb at 100%, which produces this declaration:

background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);

Now put a white headline across it. At the #2563eb end, a deep blue, white letters are crisp and comfortable. Traveling toward the #0ea5e9 end, a bright sky blue, the same white letters get thinner and weaker until they are hard work to read. Nothing about the gradient is broken. The text simply fails at one end.

You have three honest fixes. Deepen the first stop until white survives it, accepting a moodier blend. Move the text block so it sits mostly over the deep end, accepting a layout constraint. Or shorten the light portion's reach by moving the light stop's position, so the pale shade lives in a corner with no text on it. Each fix trades something away, and the worked example's real lesson is that you choose the trade on purpose instead of discovering it after launch.

Limitations and honest tradeoffs

The generator builds linear, radial and conic gradients and shows a live preview, but the preview is the gradient alone, rendered as CSS in a fixed box. It is not your page, it does not contain your text, and it includes no contrast measurement. Any tool or workflow that claims to judge readability without seeing the text in place is guessing, and this one does not pretend otherwise.

The stops are solid hex colors, so the output cannot fade to transparent. A gradient that dissolves into a photo or a page color needs an extra step in your own stylesheet. And readability advice has a floor: readers with low vision need more contrast than a quick read-through by a designer with good eyesight suggests, so treat "I can read it" as the minimum bar, not the target.

Common mistakes

  • Judging the middle of the blend. The middle shade is the one place text rarely sits alone. Judge the ends, where failure actually happens.
  • Trusting the empty preview. The generator preview shows color, not readability. If no text is on it, you have checked nothing about text.
  • Adding stops because the tool allows six. Every extra stop is another shade for your letters to survive. Behind copy, two stops is a feature, not a limitation.
  • Testing only the headline. Captions, buttons and small print sit on the same gradient with thinner strokes. They fail first, so check them first.

FAQs

Why does text look fine on one side of my gradient and washed out on the other? Because the text crosses the whole blend. It may sit on a deep shade at one end and a pale shade at the other, and it only needs to fail at one end to be unreadable. Judge the gradient at its worst end for your text color, not at the middle.

Does the gradient generator check contrast for me? No. The generator builds the gradient and shows a live preview, but it has no contrast checker and it never sees your text. The check is yours: paste the declaration into your page, put real copy on top, and read it at the size it will ship.

How many color stops should a gradient behind text have? Fewer is safer. Two stops give you two ends to judge. Every extra stop adds another shade the text has to survive, and a busy multi-stop blend behind copy is one of the most common readability mistakes. The generator allows up to six stops, but text rarely needs more than two.

Can I fade the gradient to transparent so the text sits on the page color? Not with this generator. Its stops are solid hex colors, so the output never includes a transparent fade. If the design needs a fade over a photo or a page color, that step happens in your own stylesheet, not in the generated declaration.

Is white text or dark text safer on a gradient? Neither, on its own. White text fails where the blend runs light, and dark text fails where the blend runs dark. Pick the text color that survives the worst end of your gradient, or adjust the stops until one text color survives both ends.

Conclusion

Readable gradient text is not a matter of taste in colors. It is a matter of checking the worst shade under your letters and refusing to ship until that shade passes. The CSS Gradient Generator makes the building and rebuilding quick, and the discipline of reading real text at both ends does the rest. When the angle of the blend is the question rather than its colors, our guide to matching a gradient angle to your layout direction covers the direction side of the same decision. For more guides in this series, see our Website and Webmaster Tools guides, which pair each technique with the free tool that performs it.

References