shellscape / jsx-email

Build emails with a delightful DX
https://jsx.email
MIT License
902 stars 28 forks source link

SVG not rendering correctly #46

Closed mrtom closed 8 months ago

mrtom commented 8 months ago

StackBlitz link 404s unfortunately. There is a repo you can play with here.

This repo contains the code created when you use the quick start in the JSX Email docs, with a single SVG JSX file added into the starter template.

Expected Behavior

Here is what that SVG looks like when rendered in my Next app (first) and when sent using react-email (second)

Screenshot 2023-10-31 at 21 18 29 Screenshot 2023-10-31 at 21 19 05

Actual Behavior

Here is what the SVG looks like rendered by the JSX Email preview server (first) and an email generated by JSX Email (second)

Screenshot 2023-10-31 at 21 07 08 Screenshot 2023-10-31 at 21 19 10

Note the white 'tick' is missing in both cases.

Additional Information

grahamplace commented 8 months ago

I don't know the exact limitations, but as I'm starting to work with emails for the first time, my current stance is "we don't use SVG" to avoid confusion / issues

https://css-tricks.com/a-guide-on-svg-support-in-email/

shellscape commented 8 months ago

SVG support is extremely dicey. See https://www.caniemail.com/features/image-svg/

That site is also awesome for viewing compatibility of features across clients.

StackBlitz link 404s unfortunately.

Fixed the bad link. Thanks for raising it.

mrtom commented 8 months ago

Wow, I had no idea it would be so poor in 2023. OK, time to use PNGs in emails! Thanks.