Astro v4.11.5
Node v22.4.1
System Linux (x64)
Package Manager yarn
Output static
Adapter none
Integrations @astrojs/starlight
astro-icon
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Currently, the "size" property of the component is a number, which doesn't indicate what measurement it uses - is it pixels, percentage, em? It also doesn't allow said measurements, which can be limiting based on use case. (Mine being replacing the cards in starlight to use custom icons. Cards use the size 1.333em instead of a "static" size.)
This is actually possible right now - if you change the property to be a string and write something like "1.333em", TypeScript will complain about it, but the actual code itself works perfectly fine. Therefore the only thing needed is to add the string type to the property, so code using string sizes can be built.
What's the expected result?
To be allowed to use more advanced sizes like 2em and 25%.
What version of
astro-icon
are you using?v1.1.0
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Currently, the "size" property of the component is a number, which doesn't indicate what measurement it uses - is it pixels, percentage,
em
? It also doesn't allow said measurements, which can be limiting based on use case. (Mine being replacing the cards in starlight to use custom icons. Cards use the size1.333em
instead of a "static" size.)This is actually possible right now - if you change the property to be a string and write something like "1.333em", TypeScript will complain about it, but the actual code itself works perfectly fine. Therefore the only thing needed is to add the string type to the property, so code using string sizes can be built.
What's the expected result?
To be allowed to use more advanced sizes like
2em
and25%
.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-652cgt?file=src%2Fpages%2Findex.astro