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

Icon props: Accept size?: string to pass size units #213

Open
am0wa opened this issue Mar 8, 2024 · 0 comments · May be fixed by #219
Open

Icon props: Accept size?: string to pass size units #213

am0wa opened this issue Mar 8, 2024 · 0 comments · May be fixed by #219

Comments

@am0wa
Copy link

am0wa commented Mar 8, 2024

What version of astro-icon are you using?

v1.1.0

Astro Info

Astro                    v4.4.11
Node                     v18.16.1
System                   macOS (x64)
Package Manager          unknown
Output                   static
Adapter                  none
Integrations             astro-icon
                         @astrojs/starlight
                         @astrojs/tailwind

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Type error when passing size as string specifying units.

<>
  {icon && <Icon name={emojiName} size="1.999em" />}
</>
{/* error ts(2322): Type 'string' is not assignable to type 'number'. */}

What's the expected result?

Expected: make size?: string to be able to specify units aka rem, em, px, etc.
similar to real SVG width/height attributes

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-ekzvvi?file=astro.config.mjs,src%2Fpages%2Findex.astro

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 a pull request may close this issue.

1 participant