I am currently working on a website with bootstrap 4 and I am utilizing the bootstrap cards, which includes the primary button (btn-primary). My goal is to trigger the hover state of the button when hovering over the card itself. Is there a way to achieve this?
Is it possible to force an element to show its hover effect? I attempted the solution provided in the mentioned link, however, it did not work as expected. The compiler threw an error stating that btn-primary:hover compound selectors cannot be extended anymore. It suggested using @extend .btn-primary, :hover instead. While this solution works, it leads to bloating my CSS file by extending all types of hovers rather than just for buttons.
Are there other methods to activate the hover state of a bootstrap button without hovering directly over the button itself?
Below is an example of what I hope to accomplish in SCSS, if at all possible:
.card {
&:hover {
.btn {
//Need to trigger the hover state of btn-primary within the card here
}
}
}