Created
September 20, 2020 14:44
-
-
Save dillonchanis/7b76ae89d13b662eb44866f570da817b to your computer and use it in GitHub Desktop.
Tailwind Utility for using gradients with text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@layer utilities { | |
.text-gradient { | |
background-clip: text; | |
-webkit-text-fill-color: transparent; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span class="text-gradient bg-gradient-to-r from-pink-400 via-purple-400 to-indigo-500"> | |
Download for free today. | |
</span> |
<h1 class="bg-clip-text text-transparent bg-gradient-to-l from-blue-300 to-green-400">Gradient Text</h1>
this doesnt work in Safari < 15.4
Thanks for this, gradient text is the best 🤩 Just adding a note here, that if anyone wants some lovely examples of Tailwind gradients that you can add to your text, I'd recommend this collection of Tailwind gradients here. Could work beautifully with the gradient text example above. 😄
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!