Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing CSS from Angular Material Checkbox

can someone tell me, how I can change the colour of the round circle when you click the angular material checkbox. Shown in the following image (the pink circle)

enter image description here

Here is the link from the official webpage: https://material.angular.io/components/checkbox/overview

Thanks for the Help

like image 242
Peter Avatar asked Oct 17 '25 15:10

Peter


1 Answers

The checkbox (both the checkmark and the ripple), by default uses the accent color from your theme. You can change it to use the primary color by using the color = "primary" property on the element. If you want to use a custom color (i.e. not from the theme), you'd have to override the CSS manually or create a custom theme.

If you only want to override the color of the ripple, you can override the .mat-ripple-element class which is added on the generated ripple element whenever you click the checkbox. Add your desired styles to theme.scss.

.custom-ripple {
  .mat-ripple-element {
    background-color: rgba(100, 200, 50, 0.5) !important;
  }
}

Here's an example.

like image 113
Aamir Khan Avatar answered Oct 20 '25 07:10

Aamir Khan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!