[openstreetmap/openstreetmap-website] Can we avoid inlining svgs into erb templates? (Issue #5880)

Marwin Hochfelsner notifications at github.com
Sat Jul 12 17:47:52 UTC 2025


hlfan left a comment (openstreetmap/openstreetmap-website#5880)

Aha, so it's not really understanding on both sides!

I thought you meant manipulations of svg internals inside a helper module, not on invocation.

> How is that supposed to work at the same time?

Well, since the `fill` and `stroke` attributes can be set on the SVG element itself, overriding `:fill => expression` when the icon is used (requires another custom transformation for the inline_svg gem) would achieve exactly that.
```erb
<%= inline_svg_tag "changeset/comment.svg", :fill => changeset.comments.empty? ? "none" : "currentColor" %>
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/5880#issuecomment-3065908363
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/5880/3065908363 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250712/4c2e4411/attachment.htm>


More information about the rails-dev mailing list