Figma Support Forum

Any Figma SVG import compatibility guidance? Are "defs", "use", fill="url('#MyColor')" supported?

Hi All,

I’m failing to import SVG with “defs” and “use” tags. It is opened and rendered exactly as expected by Chrome but it looks like Figma is not able to manage such an SVG. The code sample is here.

<defs>
	<linearGradient id="Color.Base"><stop stop-color="lightblue"/></linearGradient>
	<linearGradient id="Color.Accent"><stop stop-color="red"/></linearGradient>

	<svg id="CPaletteColor" x="5">
		<circle cx="50" cy="50" r="40" stroke="darkgrey" stroke-width="1"/>
		<text x="100" y="60" font-size="20">Color name</text>
	</svg>
</defs>

<use y="5" href="#CPaletteColor" fill="url('#Color.Base')"/>
<use y="105" href="#CPaletteColor" fill="url('#Color.Accent')"/>
<use y="205" href="#CPaletteColor" fill="blue"/>
<use y="305" href="#CPaletteColor" fill="navy"/>

This is not supported as far as I know. But there are no specific docs on what’s supported or not. You can create a #product-ideas topic so people could vote for this feature being implemented.

@Gleb , thanks! It’s not supported for sure , cause it doesn’t work.
I’ll check how to use #product-ideas topic.
What I actually need is a kind of XML based language to describe a scene to import. Probably something like that already exists?
BR
Denis

You can only import Sketch and SVG files.

Yep. That’s what I’ve found out.
Going to try Plugins to see how powerful they are. Probably can develop the one fitting our needs.
10X
Denis