-
|
I have a custom utility function like this: @utility px-scrollbar-* {
--_pad: --value([length]);
--_pad: calc(--value(integer) * 1px);
padding-left: var(--_pad);
padding-right: calc(var(--_pad) - var(--detected-scrollbar-width));
}My problem is that I cannot use it with CSS vars, using the "short" syntax, like ml below. I can only use it in this long and ugly syntax with an added calc/var hack. Is this by definition, or I'm missing something? Would it be possible to have a utility function which works like |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
You'd need to type-hint the CSS variable to match the |
Beta Was this translation helpful? Give feedback.
You'd need to type-hint the CSS variable to match the
[length]likepx-scrollbar-(length:--chat-column-margin): https://play.tailwindcss.com/sb5sGoAikP.Otherwise, if you don't want to need to type-hint, you'd need to change the arbitrary value type to
[*]: https://play.tailwindcss.com/w38FjapPu9