-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Allow control of second argument for iconToSVG
#125
Comments
Thank you for filing this issue! I can look into adding the a way to pass the additional parameter. Would it cover your use-case to allow |
Thanks for taking a look at this one. For my particular use case, passing |
@charlie-hadden Can you provide an icon that you're testing and what you would expect it to be? That will help me ensure I get a good resolution for this. |
I've taken a bit more of a look into this, and set up a bit of a demo/writeup here https://github.com/charlie-hadden/astro-icon-reproduction/blob/unset-height/src/pages/index.astro. If you spin up that project locally then you should be able to see the behaviour I'm talking about. I also poked around with the astro-icon source a little, and handling the transformation options ( If the decision is to only support the sizing use case, then I think expanding the type for the sizing props to Do check out the demo I put together though - there are some bits which were a little easier to explain with an example. If more complete control of those options and sizing is something which this project is interested in then I'd be happy to put together a PR for it. |
Related #163 |
Sorry about that PR @charlie-hadden! If you're still interested in this, I'm definitely on board with supporting this. Maybe under a |
@natemoo-re no worries! I can take a look at creating a new PR after the holidays if nobody gets to it before me. |
Hi there,
I'm trying out v1 - so far it's working well for me aside from one issue. I see that here, you call
iconToSVG
providing only one argument:astro-icon/packages/core/components/Icon.astro
Line 102 in e66e3ad
This causes default
width
andheight
attributes to be set on the SVG, which is something which I don't want for my use case. Iconify does provide a way to avoid this using the second argument toiconToSVG
, but there's no way to control that. An alternative solution would be to pass the width and height to the Icon component, but because of the typescript types for the props, I can't see a way to clear the attributes without having to work around a type error.Aside from the dimensions, there are also some other parameters in the customization options which look useful. I'd love to see some way of controlling that parameter. Perhaps by exposing it as an optional prop on the Icon component, and maybe even setting defaults in the integration config, if that's possible.
Thanks!
The text was updated successfully, but these errors were encountered: