When I export the MSSymbolInstances as SVG I always get this line in the SVG code.
<g id="????/Fill/Gray-3" mask="url(#mask-2)" fill="#6A6A78">
It is not until that I edit the fill above manually and change "#1D1F20" to "none", can I use the SVG in my program. Is there any way to export the SVG without this particular fill or mask.
I have tried several approaches for this :-
Loop through all the layers and if it is a mssymbolinstance then export using the new sketch API sketch.export(layer, options).. This does not work.
Tried to duplicate a layer convert it to a group and then used group.export like what follows:
var duplicates = layers[j].duplicate(); var group = duplicates.detachByReplacingWithGroup(); group = new sketch.Group(group); group.export({ "formats": "svg", output : outputPath, //'use-id-for-name' : true, }); group.remove();
This also does not work as the output SVGs all have the mask with some fill color overrides.
- This approach is the same as 2. Here I just do not duplicate the layer before converting it into a group and exporting, however this has other downfalls. -> first of all it removes the symbol instances and thus the sketch document is changed. -> Secondly, I have to run it multiple times and often throws the error regarding -[NSNull name]: unrecognized selector sent to instance 0x7fffa6e3ecc0
Please Help.