Bug 189152 - -webkit-background-clip: text doesn't work across element boundaries
Summary: -webkit-background-clip: text doesn't work across element boundaries
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari Technology Preview
Hardware: Mac All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-08-30 06:48 PDT by Aaron
Modified: 2022-08-11 22:25 PDT (History)
5 users (show)

See Also:


Attachments
Here's the small HTML testcase attach (1.32 KB, text/html)
2018-08-31 12:35 PDT, Aaron
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron 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;
}
Comment 1 Simon Fraser (smfr) 2018-08-31 11:35:52 PDT
Can you attach a small HTML testcase please?
Comment 2 Aaron 2018-08-31 12:35:31 PDT
Created attachment 348662 [details]
Here's the small HTML testcase attach
Comment 3 Radar WebKit Bug Importer 2018-08-31 12:45:18 PDT
<rdar://problem/43951596>
Comment 4 Aaron 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!
Comment 5 Aaron 2018-09-24 18:14:23 PDT
Do you have any questions?
Comment 6 Myles C. Maxfield 2018-09-28 16:39:36 PDT
Yes, I can reproduce the problem. Thanks for the testcase!
Comment 7 mic.gallego 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).