Is there a way to be able to use a set of the color options to generate custom compoents with all the color options? #3935
-
I would like to do something where I generate a custom component styles for all the colors. Is there a way to do this programatically so if new colors are added they are also generated and so I dont have to have a bunch of duplication?
|
Beta Was this translation helpful? Give feedback.
Answered by
saadeghi
Jun 5, 2025
Replies: 1 comment
-
Yes. example: @utility my-component-* {
@apply border-l-4 m-4 p-4;
border-left-color: --value(--color-*);
} Docs: https://tailwindcss.com/docs/adding-custom-styles#functional-utilities |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
saadeghi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes. example:
https://play.tailwindcss.com/LhTGgRs2qp?file=css
Docs: https://tailwindcss.com/docs/adding-custom-styles#functional-utilities