skip to Main Content

In my project black theme we are using so, need to show checkbox border color with white border. But, css is not working in checkbox and border color is not changing.

Is there any way to change the border color of mat-checkbox? I am using angular material checkbox that link I have written below.

Checkbox Image

Angular material checkbox

2

Answers


  1. The below CSS seems to do the job, kindly change it based on your requirements!

    .mdc-checkbox
      .mdc-checkbox__native-control:enabled
      ~ .mdc-checkbox__background {
      border-color: red !important;
      background-color: transparent;
    }
    

    stackblitz

    Login or Signup to reply.
  2. ::ng-deep .custom-checkbox .mat-checkbox-frame {
      border-color: #ff0000 !important;  /* Change this to the desired color */
    }
    
    
    <mat-checkbox
      class="custom-checkbox"
      color="primary"
    >
      Check me!</mat-checkbox
    >
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search