Skip to content

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

Closed Answered by saadeghi
anthonylex asked this question in Q&A
Discussion options

You must be logged in to vote

Yes. example:
https://play.tailwindcss.com/LhTGgRs2qp?file=css

@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

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by saadeghi
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