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

Add migration explanation to non-deprecated utils and tools #4

Open
manuelmeister opened this issue Oct 6, 2022 · 1 comment
Open

Comments

@manuelmeister
Copy link

Hey thank you for the awesome iconify!

I'm using astro-icon which itself uses the json-tools. I noticed it still uses v1 which means that some icons are not found. I tried to migrate astro-icon to iconify v2 but struggle to understand how to move away from @iconify/json-tools to @iconify/utils and @iconify/tools. What would the maintainer of astro icon need to do, to implement v2?

@cyberalien
Copy link
Member

That depends on what functions you need.

I guess you need to extract icons from IconifyJSON, then render them as SVG? Then use getIconData() to extract icons and iconToSVG() to generate SVG.

See https://docs.iconify.design/tools/utils/get-icon-data.html and https://docs.iconify.design/tools/utils/icon-to-svg.html

Code samples for both functions show exactly how it is done.

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

No branches or pull requests

2 participants