Replies: 1 comment 1 reply
-
It seems like having a modifier defined will activate this functionality: https://tailwindcss.com/docs/adding-custom-styles#modifiers, related: #16167 <div class="text-default">text-default</div>
<div class="text-default/50">text-default/50</div>
<hr>
<div class="text-blue">text-blue</div>
<div class="text-blue/50">text-blue/50</div> @import "tailwindcss";
@theme {
--default: red;
--blue: blue;
}
@utility text-* {
--alpha: calc(--modifier(integer) * 1%);
color: --alpha(--value(--*, [color]) / var(--alpha, 100%));
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to make a simple utility that defines a text color depending on dark mode but keeps the given opacity
It fails with this message
When digging the code it's clear that the Regex doesn't support it
tailwindcss/packages/tailwindcss/src/utilities.ts
Line 28 in a8c54ac
Is there a way to do what I want to achieve?
Beta Was this translation helpful? Give feedback.
All reactions