Skip to content
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

Minifying filter defs in inline SVG #11

Closed
sciloqi opened this issue Dec 22, 2023 · 3 comments
Closed

Minifying filter defs in inline SVG #11

sciloqi opened this issue Dec 22, 2023 · 3 comments

Comments

@sciloqi
Copy link

sciloqi commented Dec 22, 2023

I have some issues with filters and encapsulated tags in the SVG defs section (inline) while minifying:

<svg width="100%" height="100%" viewBox="0 0 460 340" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg">
  <defs>
    <filter id="drop-shadow-filter-0" color-interpolation-filters="sRGB" x="-500%" y="-500%" width="1000%" height="1000%">
      ...
      <feComponentTransfer result="offsetblur" in="offset-0">
        <feFuncA id="spread-ctrl" type="linear" slope="1.32"/>
      </feComponentTransfer>
      ...

results in

<svg width="100%" height="100%" viewBox="0 0 460 340" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg">
  <defs>
    <filter id="drop-shadow-filter-0" color-interpolation-filters="sRGB" x="-500%" y="-500%" width="1000%" height="1000%">
      ...
      <feComponentTransfer result="offsetblur" in="offset-0"></feComponentTransfer>
      <feFuncA id="spread-ctrl" type="linear" slope="1.32"></feFuncA>
      ...

closing <feComponentTransfer> to early and bringing <feFunc> one level up. None of the options made a difference...

Happy Holidays 🎄

@hexydec
Copy link
Owner

hexydec commented Dec 25, 2023

Hey, thanks for letting me know about this and providing an example, looks like the feComponentTransfer element was incorrectly listed as a singleton.

Have removed from the list and should now work correctly.

Happy holidays to you too.

@hexydec hexydec closed this as completed Dec 25, 2023
@sciloqi
Copy link
Author

sciloqi commented Dec 29, 2023

Great, thank you!

The same goes for feMerge. I removed it from the configuration like you did with feComponentTransfer and now I can see all my filters again...!

hexydec added a commit that referenced this issue Dec 30, 2023
@hexydec
Copy link
Owner

hexydec commented Dec 30, 2023

Have checked over the whole list now, also removed feDiffuseLighting.

Let me know if any more issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants