Svelte & Tailwind Dynamic Icon Color #982
-
Hey. I am using the svelte library of Lucide alongside with TailwindCSS. I want to use a color from my Tailwind config without having to hardcode it in the "color" prop of the icon component. Reading the Tailwind config (https://tailwindcss.com/docs/configuration#referencing-in-java-script) is not an option for me. Does anybody have an idea? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Yes you can use: For example <Airplay class="text-red-500" /> Will make the icon red! |
Beta Was this translation helpful? Give feedback.
-
@ericfennis in the same vein, is it possible to use a tailwind class for size as well? |
Beta Was this translation helpful? Give feedback.
Yes you can use:
text-{color}
.For example
Will make the icon red!