I'm currently working on customizing the color of Bootstrap 4 buttons. Specifically, I want to change the color of btn-primary
when it is being clicked. It seems like there should be a button event that triggers this color change, but I've tried using hover
, focus
, and active
without success.
In my experiments, I managed to make the button with the btn-primary
class turn completely red, except when clicking on it, which then made the button blue. I am generating CSS styles using Sass.
This is what I have in my app.scss file:
.btn-primary {
&:hover {
color: red;
background-color: red;
}
&:focus {
color: red;
background-color: red;
}
&:active {
color: red;
background-color: red;
}
}
Is there a way to set the color of the button while it's being clicked?