ui icon indicating copy to clipboard operation
ui copied to clipboard

Add color prop to UIcon

Open isakgustavsen opened this issue 10 months ago • 2 comments

Description

Looking at Iconify I see that it supports colors for but that is not included in <UIcon>. As far as i can tell, it is easy to add the 140 colors in this list, but I am not sure how to add the tailwind configed colors.

I would love to add it myself with some guidance, or pass this onto someone who knows more

Additional context

No response

isakgustavsen avatar Apr 14 '24 22:04 isakgustavsen

I now found an issue from last year about this. Personally it seems like a color prop here would be better than adding a tailwind class but is there a reason it hasn't been added?

isakgustavsen avatar Apr 14 '24 22:04 isakgustavsen

I believe Icons are not plain components that depend on a tailwind palette. They will just take the currentColor to fill the icon's SVG. Basically, any svg whose path's fill property is currentColor will take the color the surrounding text is supposed to have. So if you want to apply the color blue-500, just put class="text-blue-500" on your Icon

noook avatar Apr 15 '24 07:04 noook