Mesh Gradient Background
Three blurred radial pools over an opaque base - a mesh section that never has to fight its own text for contrast.
6 个框架初级
A headline painted with a gradient via bg-clip-text - still real, selectable, announced text.
<!--
bg-clip-text does not change what the text *is*: it stays real, selectable,
announced text - only the paint changes. The two things that do change are
contrast (judge the darkest and lightest stop against the page, never the
average) and clipping: the gradient is clipped at the content box, so a
tight line-height puts descenders outside it. The bottom padding on the
title is not rhythm - it is where the descenders live.
-->
<div class="gradient-text">
<p class="gradient-text__kicker">The 2026 report</p>
<h2 class="gradient-text__title">Design is how it works</h2>
<p class="gradient-text__copy">
One gradient across the headline, solid ink everywhere else - the copy has
to carry the reading, so it stays flat.
</p>
</div>| Prop | 类型 | 默认值 | 说明 |
|---|---|---|---|
title必填 | string | - | 卡片的标题文本。 |
kicker | string | - | 显示在标题上方的小标签。 |
copy | string | - | 显示在标题下方的正文文本。 |
className | string | - | 合并到根元素上的额外类名。 |
`bg-clip-text` changes the paint, not the text: it stays selectable, findable and announced, so there is nothing to do for screen readers. Two things do need care. Contrast: judge each stop against the page on its own - the darkest and the lightest stop decide legibility, never the average - which is why the `dark:` stops are each one shade lighter (`blue-600` is muddy on near-black, `blue-400` is not). Clipping: the gradient clips at the content box, and a tight line-height puts the descenders of g, y and j outside it - the `pb-1` on the headline is descender room, not rhythm; remove it and the tails get sliced. The CSS tab also sets a solid `color` before the clip properties as a fallback, so browsers without `background-clip: text` show violet text instead of invisible text. Keep the gradient to the headline; body copy has to carry the reading and stays flat.