Skip to content

how can I set the icon size as percentage in TS? #1450

Discussion options

You must be logged in to vote

Hey @GhostOrder28! I think we typically expect icons to be sized in units (i.e. a number)

evergreen/index.d.ts

Lines 3183 to 3187 in 10e8e23

* Size of the icon, in pixels.
* Blueprint contains 16px and 20px SVG icon images,
* and chooses the appropriate resolution based on this prop.
*/
size?: number

If you have a specific use-case for a percentage or string-based value (and it was working as you expected), it should still work by casting it:

<ArrowUpIcon size={('100%' as any) as number} />

As for setting the class names directly, I would not recommend that - ui-box and glamor both manage helper class creation/application and aren't really meant t…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@GhostOrder28
Comment options

@brandongregoryscott
Comment options

Answer selected by brandongregoryscott
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants