I have an ul with several li.
I use this id on the ul.
#list {
margin-right: auto;
margin-left: auto;
width:500px;
color:black;
background: -webkit-linear-gradient(#000, #909090);
-webkit-text-fill-color: transparent;
-webkit-background-clip: text;
}
The contents of the ul receive a gradient treatment just fine in Chrome but not Safari. In Safari, all of the li are "invisible". If I inspect and then disable the "-webkit-text-fill-color: transparent;", the text will become visible albeit without the gradient (obviously).
Thoughts?
Here is the JSfiddle: https://jsfiddle.net/s96bzcua/
Kind regards,
I had this same issue. Turns out it was due to the display property. For whatever reason, Safari needs the display set to "inline" or "inline-block", but not "inline-flex".
So for me this meant changing From: display: flex; To: display: inline;
To someone coming to this, just drop -webkit-text-fill-color: transparent;
as it's not a standard and is not on a standard track.
Use instead color: transparent
and wrap everything in an @supports
to prevent color transparent from being used in case background-clip: text
is not supported.
Here's an example: https://jsfiddle.net/0oeftdbk/5/
––
As per the 🐛 bug of the gradient not showing clipped inside the text on Safari, it looks like that if it's applied on the parent element and not directly to the children, all the children need to be display: inline
or a inherently inline element such as span
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With