How to achieve this text color

No description
9 Replies
Code-S β™›
Code-S β™›OPβ€’3w ago
its like a gradient on the text but in a weird way
i_lost_to_loba_kreygasm
background-clip:text I think
i_lost_to_loba_kreygasm
I would prefer someone more experienced to guide the path though as I am not sure if I am correct or there is better way
Code-S β™›
Code-S β™›OPβ€’3w ago
Yes i think it works fine
i_lost_to_loba_kreygasm
add max-width or width:fit-content so the gradient looks better πŸ™‚
Jochem
Jochemβ€’3w ago
nah, you got it. That's the main way to do gradient text atm afaik
capt_uhu
capt_uhuβ€’3w ago
yep yep, background-clip: text; is the way for this right now. Good on you though for noticing how odd it is. background-clip: text; is a super hacky thing but it's all we have right now. The official way to do this is going to be a "fill" property but no browser supports it yet: https://www.w3.org/TR/fill-stroke-3/#fill-shorthand
clevermissfox
clevermissfoxβ€’3w ago
Don’t forget to set the text color to transparent to allow the bg gradient to show. And prefixed -webkit-background-clip:text;

Did you find this page helpful?