Design comparison
SolutionDesign
Solution retrospective
Could not figure out how to make the button hover background color animation work with Tailwind CSS, when transitioning to a gradient.
Simple example
Transitioning to a single color works fine:
<button class="bg-slate-400 transition duration-500 hover:bg-slate-700">Continue</button>
Transitioning to a gradient does not seem to work:
<button class="bg-slate-400 transition duration-500 hover:bg-gradient-to-b from-slate-100 to-slate-700">Continue</button>
To be clear, the background changes correctly when hovering, but the change happens instantly without any animation applied.
Community feedback
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord