Replies: 1 comment 1 reply
-
You make your own utility classes to do this: @layer utilities {
.alert-bg {
background-color: var(--alert-bg);
}
.alert-border {
border-color: var(--alert-border);
}
} Otherwise, if you can tolerate having the module.exports = {
theme: {
extends: {
backgroundColor: {
alert: 'var(--alert-bg)',
},
borderColor: {
alert: 'var(--alert-border)',
} <div className="bg-alert border-alert"></div> |
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.
-
all defined colors,can be used as bg (with bg prefix),can be used as border (with border prefix) and so on, but the literal I defined already contains the usage of the variable, bg or border for human reading; and for truely usage, I need to add prefix to let tailwindcss known how to use the variable;
Is there a way, identify the usage of variables based on contain the specified work, not prefix. like this
tailwindcss know alter-bg is a backgroundColor, and alert-border usage to border;
Beta Was this translation helpful? Give feedback.
All reactions