-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
SVGs with light or white fill not working #45
Comments
@Jaimish00 Interesting issue, thanks for the detailed post. So right now the package does not support gradient svgs (I did not have this in mind when I created it). This due to the way it works under the hood. It takes the svg and puts it in front of a white canvas then uses an algorithm to trace the svg from scratch using the proper technique so that it has fills instead of strokes. That's why this doesn't work And this does The algorithm cannot 'see' the svg because of the white canvas (or background) so it outputs an empty svg. I think I can fix this but I will need more info first.
<svg width="24" height="24" viewBox="0 0 24 24" fill="none"
xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.672 2.814 C 11.409 2.888,11.175 3.054,11.045 3.259 C 10.984 3.355,10.443 4.555,9.842 5.927 C 9.241 7.298,8.735 8.436,8.718 8.455 C 8.700 8.474,7.402 8.595,5.833 8.723 C 4.001 8.872,2.908 8.978,2.778 9.017 C 2.518 9.097,2.266 9.314,2.129 9.574 C 2.041 9.744,2.022 9.832,2.022 10.080 C 2.022 10.401,2.094 10.594,2.291 10.802 C 2.345 10.858,3.354 11.712,4.534 12.699 C 5.714 13.687,6.680 14.513,6.680 14.535 C 6.680 14.557,6.390 15.773,6.035 17.237 C 5.593 19.067,5.391 19.970,5.391 20.125 C 5.392 20.724,5.902 21.199,6.546 21.200 C 6.912 21.200,6.830 21.242,9.711 19.565 L 12.002 18.230 14.491 19.684 C 17.272 21.309,17.249 21.299,17.705 21.186 C 18.032 21.105,18.300 20.919,18.459 20.661 C 18.557 20.503,18.581 20.416,18.592 20.184 C 18.603 19.931,18.535 19.614,17.962 17.246 C 17.609 15.786,17.320 14.570,17.320 14.543 C 17.320 14.517,18.233 13.731,19.350 12.798 C 20.466 11.865,21.483 11.005,21.609 10.886 C 21.967 10.548,22.073 10.179,21.940 9.733 C 21.869 9.494,21.617 9.191,21.395 9.077 C 21.185 8.970,21.018 8.952,17.960 8.698 C 16.497 8.576,15.290 8.464,15.276 8.448 C 15.263 8.433,14.770 7.322,14.181 5.980 C 13.593 4.638,13.065 3.453,13.008 3.347 C 12.771 2.906,12.182 2.671,11.672 2.814 " fill="url(#paint0_linear)" />
</g>
<defs>
<linearGradient id="paint0_linear" x1="12" y1="19.5" x2="12" y2="1.16667" gradientUnits="userSpaceOnUse">
<stop stop-color="#5B4308" />
<stop offset="1" stop-color="#E5A40A" />
</linearGradient>
<clipPath id="clip0">
<rect width="20" height="20" fill="white" transform="translate(2 2)" />
</clipPath>
</defs>
</svg> |
Actually, I am using the webfont package to generate the icon fonts. In that package, while creating the icons, some of the icon portions were getting removed in the final .ttf file. So I tried this package and it worked perfectly. We were getting all the icons perfectly, except some of these icons that I've mentioned above. Regarding the Gradient icon, this SVG code that I've put is the original one! For the time being, the Gradient icons are not the priority. I've tested them just to debug this issue. |
@Jaimish00 ohh ok, so you just want white/light svgs to work correct? |
@Ghustavh97 Yes, exactly. I've not found any other issues with the package. |
feat: add support for svgs with light colored fill (#45)
@Jaimish00 try out |
@Ghustavh97 It worked. Thanks a lot 😁. |
@Jaimish00 no problem |
Preview,
After fixing up this SVG, it is generating this,
Preview,
It is working fine with this SVG, the output is this
Preview,
The output, in this case,
Preview,
I am not able to understand why it is happening, Can anyone help me out with this?
The text was updated successfully, but these errors were encountered: