I'm trying to add a drop shadow on this text, but it's always appearing inside the text. Is there a way to make the part of the shadow that's inside the text disppear/go behind the background image?
.mask {
background-image: radial-gradient(purple, gold);
background-size: cover;
mix-blend-mode: luminosity;
background-repeat: no-repeat;
-webkit-background-clip: text;
color: rgba(254, 185, 90, .3);
font-size: 4em;
font-family: impact;
font-weight: bold;
}
/*
The issue comes when I try to add shadow to the text, because it covers the background:
*/
.withShadow {
text-shadow: 1px 1px 1px black;
}
<span class="mask">My Text</span>
<span class="mask withShadow">My Text</span>
It creates a shadow, but since the text is (mostly) transparent, most of the shadow is inside the text. Is there a way to get rid of the part of the shadow that's inside the text, either with css or javascript?
Thanks!