You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to upgrade from v3 to v4 and we did generate a lot of utilities using plugins and matchUtilities with v3.
Let's imagine that I had an utility class which would work like that: .custom-background-red would @apply bg-red-500;. Of course, i want to do that for all of the colors defined in my theme.
The question is: how to write that with @utility and *
I have tried many attempts like the following:
is working but i have to pass the full name of the color. It seems that if there is something after the * in value then it does not work. I want to be able to pass a color scheme name and the @utility deals with the steps.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I try to upgrade from v3 to v4 and we did generate a lot of utilities using plugins and
matchUtilities
with v3.Let's imagine that I had an utility class which would work like that:
.custom-background-red
would@apply bg-red-500;
. Of course, i want to do that for all of the colors defined in my theme.The question is: how to write that with
@utility
and*
I have tried many attempts like the following:
but nothing gave me what I want to achieve and there is not much documentation about
--value
currently.NB: If this is not the proper approach for this, please let me know, it is completely possible that I go the wrong way.
Thank you!
EDIT:
I found out that:
is working but i have to pass the full name of the color. It seems that if there is something after the * in value then it does not work. I want to be able to pass a color scheme name and the
@utility
deals with the steps.Beta Was this translation helpful? Give feedback.
All reactions