Skip to content

Custom hover not working #3414

Answered by hugovntr
feelixe asked this question in Help
Discussion options

You must be logged in to vote

Hello,

You could use regular css to do that

/* Your code */
.btn-red:hover {
    background-color: theme("colors.red.400"); /* using the theme helper */
}

AFAIK @variant hover only works if you add the hover prefix, so in your case

<a class="btn hover:btn-red mt-3">Text here</a>

I made a Tailwind playground project so you can see if that fits your needs.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by feelixe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants