I’m having a problem with SVG exporting. It seems like Sketch exports SVGs with inner borders incorrectly. Can I fix this myself, or should I wait for Sketch to fix it? Please help, thank you!
I’m afraid you’ve run into a limitation with how the SVG output format handles certain effects. Your design looks fine on the Canvas because Sketch can blend the semi-transparent inner border with the fill color underneath it. However, our SVG output export doesn’t properly support inner borders with transparency, so the export looks different. We’re aware of these limitations, but I can’t say when we might have this sorted out on our side, sorry
Your idea of creating a “new color” is the right workaround for this situation. Here’s a quick step-by-step guide:
Select the shape with the semi-transparent inner border and select the border fill on the Inspector.
Press ⌃ C to bring up the Eyedropper tool.
Click on the inner border area on your Canvas. This will pick up the final, displayed color. I mean, the one that mixes your border and the fill beneath it.
In the Inspector, you’ll see that this new color has been applied to your border. When you do that, see that its Opacity is automatically set to 100%.
Now, try exporting to SVG again. It should look the same.
See a video we’ve made showing the process in action:
I’m perfectly aware this is not a bullet-proof solution, though. If the border is over some effects like blurs, or on top of a bitmap, the steps above won’t make it.
This makes me wonder… Is exporting to SVG essential in your current workflow? Could you use a different output format in these cases?
Thank @JorgeF so much!
Currently, I use the PNG format, but I might switch to the SVG format for better customization. Using colors without an alpha is inconvenient for me. I’ve also tried Figma, and it can handle this, so it would be great if Sketch could do it too!