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

fix: The sol icon is replaced with base64 #3106

Conversation

friendlysxw
Copy link

@friendlysxw friendlysxw commented Dec 23, 2024

567596ff4aa8f656659fccd1b712cd9
In the SVG of sol, there is an id, and this SVG will render multiple times in the document flow, causing the id to repeat. Once the id is duplicated, the SVG will not render properly. To solve this problem, you can consider using PNG images or converting the SVG to base64 images.

After the modification:
d3e55ca804ae9c208b5a41c6232fc56

Copy link

netlify bot commented Dec 23, 2024

👷 Deploy request for wormhole-connect pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 78ef878

Copy link

netlify bot commented Dec 23, 2024

👷 Deploy request for wormhole-connect-mainnet pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 78ef878

@emreboga
Copy link
Collaborator

Hey @friendlysxw , thanks for the PR! I looked into this and not 100% sure if the icon problem is due to multiple Solana svgs having same id LinearGradient elements. Yes, you will have multiple html elements of the same id, which is not ideal; but these elements with same ids are essentially the same elements. Whichever one browser picks when referred by url(#element_id) will result in the same look. You can see this in PortalBridge as well. Those Solana icons all have duplicate LinearGradient elements, but still render fine:
Screenshot 2024-12-23 at 7 38 20 PM

Do you get any warnings/errors in the browser console regarding this? Which browser version are you using?

@friendlysxw
Copy link
Author

friendlysxw commented Dec 25, 2024

@friendlysxw,感谢 PR!我研究了这个问题,但不能 100% 确定图标问题是否是由于多个 Solana svg 具有相同的 idLinearGradient元素造成的。是的,您将拥有多个具有相同 id 的 html 元素,这并不理想;但这些具有相同 id 的元素本质上是相同的元素。无论浏览器在引用时选择哪一个,url(#element_id)都会产生相同的外观。您也可以在 PortalBridge 中看到这一点。这些 Solana 图标都有重复的 LinearGradient 元素,但仍然可以正常渲染: 截图 2024-12-23 下午 7 点 38 分 20 秒

您在浏览器控制台中收到与此相关的任何警告/错误吗?您使用的是哪个浏览器版本?

No errors and related alerts in the console.

Chrome/131.0.0.0

@friendlysxw
Copy link
Author

friendlysxw commented Dec 25, 2024

@friendlysxw,感谢PR!我研究了这个问题,但不能100%确定图标问题是否是由于多个Solana svg 具有相同idLinearGradient的元素造成的多个。是的,您将拥有具有相同id 的html 元素,这不是理想的;但这些相同id 的元素本质上是具有相同的元素。浏览器在引用时选择其中一个,url(#element_id)都会产生相同的外观。您也可以在PortalBridge中看到这一点。这些Solana图标都有重复的LinearGradient元素,但仍然可以正常渲染: 截图2024-12-23下午7点38分20秒

您在浏览器控制台中收到此相关的任何警告/错误吗?您使用的是哪个浏览器版本?

Oh, yes.
The styles of the elements corresponding to url(#element_id) are the same, which is indeed not a problem in the demo.

The possible issue is that there is an element with the same id in my project but with a different style. However, in my project, I couldn't find any elements other than this SOL icon using document.querySelectorAll("#paint0_linear_85_9551"), which also confuses me a bit...

The only way I can currently solve this problem is to replace the SVGs with id attributes in this repository with other image formats, or to ensure that the ids in the SVGs are unique.

Copy link
Collaborator

@artursapek artursapek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR, but we want to stay on SVG for all our icons. is there another solution that keeps it as an SVG?

@aadam-10
Copy link
Contributor

closing this pr to keep the queue clean. @friendlysxw please let us know if you have updates and we can reopen it.

@aadam-10 aadam-10 closed this Jan 16, 2025
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

Successfully merging this pull request may close these issues.

4 participants