-
Notifications
You must be signed in to change notification settings - Fork 463
Closed
Description
Hello! I’m writing an article about different methods of using SVGs in React projects.
While experimenting with the SVG sprite approach in the epic-stack app, I noticed an issue: the Remix icon doesn’t appear in Safari.
Steps:
- Copy all logos to the
other/svg-icons/dir so they get embedded intosprite.svg - In
app/routes/_marketing/index.tsx, render the icons with the<Icon/>component instead of<img> - Open the app in Safari
The result:
The Remix icon is not displayed (while all other icons are visible):
if I render the logos using regular <img> tag (as in a fresh epic-stack install), all logos display correctly in Safari:
Edits to app/routes/_marketing/index.tsx:
- <img src={logo.src} alt="" />
+ <Icon name={getIconName(logo.alt)} className="size-16" />
// ...
+function getIconName(logoAlt: string) {
+ return logoAlt.toLowerCase()
+ .split('.')[0]
+ ?.replace(/\W/g, '-')
+ ?.replace('tailwind-css', 'tailwind'
+ ?.replace('radix-ui', 'radix') as IconName;
+}
I suspect this issue is related to the use of filters inside the Remix logo SVG.
Did you encounter this behavior? Are there any workarounds?
Thanks you!
Metadata
Metadata
Assignees
Labels
No labels

