I have a custom class set-up, I'm trying to add variants but seems the behaviour doesn't change from classic CSS.
@layer components {
@variants hover, focus {
.btn-primary {
background-color:blue;
}
}
.btn-primary{
@apply bg-primary rounded-sm border-4 border-primary rounded-sm text-white text-base py-2 px-4 capitalize transition-all;
}
}
If the variants is after the .btn-primary
, then it applies the blue background like it's nothing.
Hover nor focus work.
Here what I've add in my tailwind config based on other posts I've seen :
variants: {
extend: {
backgroundColor: ['hover'],
}
}