[openstreetmap/openstreetmap-website] Can we avoid inlining svgs into erb templates? (Issue #5880)
mmd
notifications at github.com
Mon Apr 7 19:33:03 UTC 2025
mmd-osm left a comment (openstreetmap/openstreetmap-website#5880)
For additional context: the "icon" in line 137 of `external_svg` refers to an additional `id="icon"` I had to add to each of the external svgs, like in this example:
```xml
<svg xmlns="http://www.w3.org/2000/svg" id="icon" width="12" height="12" viewBox="0 0 12 12">
```
I haven't really tested, if it's possible to externalize `fill="currentColor"` by adding a css class (e.g. education) to the svg:
```
.education {
fill: #39ac39;
}
```
... and then use "currentColor" instead of "#39ac39".
External svgs (rather than inlining) would benefit from browser caching. Downloading lots of small SVGs shouldn't be much of an issue with HTTP/2.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/5880#issuecomment-2784431604
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/issues/5880/2784431604 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250407/932aa285/attachment-0001.htm>
More information about the rails-dev
mailing list