NEW189152
background-clip: text doesn't work on inline-block child of inline element
https://bugs.webkit.org/show_bug.cgi?id=189152
Summary background-clip: text doesn't work on inline-block child of inline element
Aaron
Reported 2018-08-30 06:48:44 PDT
If you code like this <h1>Discover <span>Something</span></h1> with span tag inside it then text gradient won't appear in Safari but does appear fine in Chrome and Firefox. If you do like this <h1>Discover Something</h1> without span tag then it does work properly. I don't think Safari liked tags inside the tag. Nasty bug. It works on other browsers like Chrome and Safari. h1 { background: -webkit-linear-gradient(45deg, $gold 20%, #00ff95); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
Attachments
Here's the small HTML testcase attach (1.32 KB, text/html)
2018-08-31 12:35 PDT, Aaron
no flags
Simple text case (539 bytes, text/html)
2024-08-08 21:43 PDT, Simon Fraser (smfr)
no flags
Simon Fraser (smfr)
Comment 1 2018-08-31 11:35:52 PDT
Can you attach a small HTML testcase please?
Aaron
Comment 2 2018-08-31 12:35:31 PDT
Created attachment 348662 [details] Here's the small HTML testcase attach
Radar WebKit Bug Importer
Comment 3 2018-08-31 12:45:18 PDT
Aaron
Comment 4 2018-09-04 07:35:53 PDT
Were you able to see the preview of each browser differently? I hope my code helps. Thank you!
Aaron
Comment 5 2018-09-24 18:14:23 PDT
Do you have any questions?
Myles C. Maxfield
Comment 6 2018-09-28 16:39:36 PDT
Yes, I can reproduce the problem. Thanks for the testcase!
mic.gallego
Comment 7 2022-08-11 22:25:52 PDT
Hi, Is there any follow-up on this ticket? I have just created a reproduction test case here: https://codepen.io/bakura10/pen/QWmVmEP In our use case, I need the inner span to be a display inline-block to set a min-width to perform a transition (while the parent needs to stay inline to apply the background and not cut it properly). Unfortunately, in this situation, Safari does not display the inline-block part (Chrome and Firefox have no issue).
Simon Fraser (smfr)
Comment 8 2024-08-08 21:38:26 PDT
This works correctly now.
Simon Fraser (smfr)
Comment 9 2024-08-08 21:39:53 PDT
Well, the attachment works, but the codeine still shows an issue.
Simon Fraser (smfr)
Comment 10 2024-08-08 21:43:08 PDT
Created attachment 472093 [details] Simple text case
Note You need to log in before you can comment on or make changes to this bug.