custom gradient in tailwindcss #19001
-
|
hi guys, i have issues when added customize gradient colors at my side, the gradient seems not work
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
:root {
--axora: linear-gradient(101.98deg,oklch(0.53 0.25 259) 41.25%,oklch(0.75 0.19 194) 130.18%);
}
@theme inline {
--color-axora: var(--axora);
}Doing: <div class="text-axora">Would result in: .text-axora {
color: var(--axora);
}Which is like: .text-axora {
color: linear-gradient(101.98deg,oklch(0.53 0.25 259) 41.25%,oklch(0.75 0.19 194) 130.18%);
}This is invalid CSS and hence would not do anything. |
Beta Was this translation helpful? Give feedback.
-
|
Undocumented, but custom gradients are accepted in the @theme {
--background-image-custom: linear-gradient(101.98deg,oklch(0.53 0.25 259) 41.25%,oklch(0.75 0.19 194) 130.18%);
}<div class="bg-custom size-32 border-2"><!-- ... --></div> |
Beta Was this translation helpful? Give feedback.
Undocumented, but custom gradients are accepted in the
--background-image-*namespace, which can then only be used with thebg-*utility.backgroundImagein tailwind.config.js not working after upgrade to TailwindCSS v4