I want to achieve an effect similar to the Clash Royale glowing text in CSS.
Looking online I’ve only found ways to make the text glow, yet not dynamically. Mainly I found this link which highlights how to make the glowing part, and this link with many different options to make the text dynamically animated. Is it possible to combine the 2 into that result?
2
Answers
You could use a background animation with
background-clip: text;
and the glow effect (using
text-shadow
) on a::before
pseudo element:You can also try the below code:
Explanation of the above CSS:
linear-gradient:
I have used the gradient from here. You can adjust the color as per your needs.background-clip: text;
– to make the background of the text transparent.text-fill-color: transparent;
– to make the applesauce text transparent.background-size: 200% auto;
– to make the background twice as wide as the text. And why this is required because if the background is not twice as wide as the text, the animation will not be visible because the background will not extend beyond the text.animation shorthand
.