diff --git a/.changeset/nine-poems-teach.md b/.changeset/nine-poems-teach.md new file mode 100644 index 0000000..08dfbbc --- /dev/null +++ b/.changeset/nine-poems-teach.md @@ -0,0 +1,5 @@ +--- +"astro-icon": patch +--- + +Added better typings for height, width and size to accept non-number values (i.e. 2 rem) diff --git a/packages/core/components/Icon.astro b/packages/core/components/Icon.astro index 43d202d..341ef0a 100644 --- a/packages/core/components/Icon.astro +++ b/packages/core/components/Icon.astro @@ -11,9 +11,9 @@ interface Props extends HTMLAttributes<"svg"> { name: Icon; "is:inline"?: boolean; title?: string; - size?: number; - width?: number; - height?: number; + size?: number | string; + width?: number | string; + height?: number | string; } class AstroIconError extends Error { diff --git a/packages/www/src/content/docs/guides/components.mdx b/packages/www/src/content/docs/guides/components.mdx index fb5378b..a475cc3 100644 --- a/packages/www/src/content/docs/guides/components.mdx +++ b/packages/www/src/content/docs/guides/components.mdx @@ -31,9 +31,9 @@ interface Props extends HTMLAttributes<"svg"> { /** Shorthand for including a