@@ -103,6 +103,64 @@ describe('backgroundClip', () => {
103103 expect ( toImage ( svg ) ) . toMatchImageSnapshot ( )
104104 } )
105105
106+ it ( 'should render WebkitTextFillColor as white over gradient' , async ( ) => {
107+ const svg = await satori (
108+ < div
109+ style = { {
110+ display : 'flex' ,
111+ alignItems : 'center' ,
112+ justifyContent : 'center' ,
113+ width : '100%' ,
114+ height : '100%' ,
115+ fontSize : 32 ,
116+ fontWeight : 600 ,
117+ background :
118+ 'radial-gradient(61.04% 180% at 55.38% 0%, #55f114 6.77%, #02ff44 26.56%, #14f13f 40.1%, #02D7FF 67.71%, #1496f3 67.72%, #02D7FF 100%)' ,
119+ backgroundClip : 'text' ,
120+ WebkitTextFillColor : '#ffffff' ,
121+ color : '#ffffff' ,
122+ textShadow :
123+ '0px 0px 2px #1677f1,0px 0px 3px #1677f1,0px 0px 4px #1677f1,0px 0px 5px #1677f1,0px 0px 5px #1677f1' ,
124+ } }
125+ >
126+ Hello
127+ </ div > ,
128+ {
129+ width : 200 ,
130+ height : 50 ,
131+ fonts,
132+ }
133+ )
134+ expect ( toImage ( svg , 200 ) ) . toMatchImageSnapshot ( )
135+ } )
136+
137+ it ( 'should render WebkitTextFillColor transparent as gradient text' , async ( ) => {
138+ const svg = await satori (
139+ < div
140+ style = { {
141+ display : 'flex' ,
142+ alignItems : 'center' ,
143+ justifyContent : 'center' ,
144+ width : '100%' ,
145+ height : '100%' ,
146+ fontSize : 32 ,
147+ background : 'linear-gradient(90deg, #ff00bc, #6400ff)' ,
148+ backgroundClip : 'text' ,
149+ WebkitTextFillColor : 'transparent' ,
150+ color : '#ffffff' ,
151+ } }
152+ >
153+ Hello
154+ </ div > ,
155+ {
156+ width : 200 ,
157+ height : 50 ,
158+ fonts,
159+ }
160+ )
161+ expect ( toImage ( svg , 200 ) ) . toMatchImageSnapshot ( )
162+ } )
163+
106164 it ( 'should preserve color' , async ( ) => {
107165 const svg = await satori (
108166 < div
0 commit comments