Skip to content
Discussion options

You must be logged in to vote

Yep! Use the wildcard (*) arbitrary value type in --value() and it should work:

@utility my-utility-* {
  property: --value([*]);
}

Otherwise, if you only want to allow a specific type, you can do so, but your class names would need to have the hint too:

@utility my-utility-* {
  property: --value([length]);
}
<div class="my-utility-(length:--css-variable)">

https://play.tailwindcss.com/XQVoUlYqM0

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by kyletcooper
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@wongjn
Comment options

wongjn Aug 26, 2025
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants