I'm attempting to set a background color when a ion-button
is clicked or maintain the ion-ripple
effect after it has filled the button in Ionic 4.
I experimented with applying custom CSS states in global.scss
, but encountered issues where the active state seemed to be quickly removed right after clicking the button:
ion-button {
&:active {
color: red;
}
&:visited {
background-color: black !important; // --background did not have any impact here
}
}
I also tried using --background-activated
, which technically worked, but did not achieve the desired effect of persisting the ripple background after the button was clicked.
I searched extensively for configuration options related to ion-ripple
, but could not find anything that would allow me to make it persistent.
One potential solution might involve utilizing the ion-ripple
component itself, but I prefer to avoid this route as it would require replacing every instance of ion-button
throughout the entire application...
Therefore, I am seeking advice on how to ensure that a generic ion-button
retains a background color after it has been clicked?