Open konsumer opened 1 year ago
I think I could definitely break this into a bunch of draw commands by hand, and for this UI it might work better (interactions, images loaded from other sources, etc) but it would be cool to just import all the static parts at once, complete with gradients and stuff.
This is the working SVG version:
Same code runs fine, just stripped out the url/defs that were having trouble, and I removed the embedded images to cut down on the size. Seems like they are both radialGradient
defs.
I think it's definitely just gradients. This simple SVG fails, too:
<svg width="380" height="236" viewBox="0 0 380 236" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="380" height="236" fill="url(#paint0_radial_1_3)"/>
<defs>
<radialGradient id="paint0_radial_1_3" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(242 62) rotate(89.3772) scale(92.0054 148.144)">
<stop stop-color="#D01010"/>
<stop offset="1" stop-color="#D9D9D9" stop-opacity="0"/>
</radialGradient>
</defs>
</svg>
And this:
<svg width="380" height="236" viewBox="0 0 380 236" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="380" height="236" fill="url(#paint0_linear_1_3)"/>
<defs>
<linearGradient id="paint0_linear_1_3" x1="245" y1="160" x2="245" y2="236" gradientUnits="userSpaceOnUse">
<stop stop-color="#D01010"/>
<stop offset="1" stop-color="#D9D9D9" stop-opacity="0"/>
</linearGradient>
</defs>
</svg>
Hi, I really like your ideas from fidget, but I was getting a bunch of errors with exported code (and even your more complex included demos) so I thought I would try to load the SVG on it's own, so at least the static parts would be all set, and I could add in dynamic parts. I am trying to make a UI (for a steamdeck-OS looking app) using an SVG outputted from figma:
And I get errors like this:
For things like this:
That are in
<defs>
like this:I thought it might be that it was using urls before the
<defs>
(figma puts them at the end) but re-arranging it did not help. If I remove all thefill="url(#WHATEVER)"
stuff, it works, but is missing all the fills, obviously.Here is the code I am using (window-scaling stuff from boxy#56):