我明白了。就像这样 - 使用 Tailwind 3 进行测试。
.text-opacity-gradient {
@apply bg-clip-text text-transparent;
background-image: linear-gradient(to bottom, black 0%, transparent 100%);
}
然后将该类应用到您的元素:
<div class="text-opacity-gradient">
your text here
</div>