generated from treeform/nimtemplate
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SVG radialGradient defs/url support #535
Comments
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. |
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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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):
The text was updated successfully, but these errors were encountered: