-
hello. who can help me guys |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is not posible without a work around. Since currently gradients don't support transitions. This is not just for Tailwind CSS but also for CSS in general. One way to archive this, is to double the background size of the element and transition the background position. By extending module.exports = {
theme: {
extend: {
backgroundSize: {
'size-200': '200% 200%',
},
backgroundPosition: {
'pos-0': '0% 0%',
'pos-100': '100% 100%',
},
},
},
plugins: [],
} And the button should be like this: <button class="p-10 text-white rounded duration-500 bg-gradient-to-r from-cyan-500 via-blue-500 to-cyan-500 bg-size-200 bg-pos-0 hover:bg-pos-100">Hover me</button> Note that we use the
|
Beta Was this translation helpful? Give feedback.
This is not posible without a work around. Since currently gradients don't support transitions. This is not just for Tailwind CSS but also for CSS in general.
One way to archive this, is to double the background size of the element and transition the background position.
By extending
backgroundSize
andbackgroundPosition
in ourtailwind.config
. Like this:And the button should be like this: