How to set color of toggle buttons

后端 未结 5 700
春和景丽
春和景丽 2020-12-24 14:10

I have group of toggle buttons. They are very light and disappear in the background on poor monitors with a high brightness level.

How can I properly style

5条回答
  •  梦毁少年i
    2020-12-24 14:51

    Add the following styles in styles.scss

    @import '~@angular/material/theming';
    @include mat-core();
    
    $primary: mat-palette($mat-indigo);
    $accent: mat-palette($mat-yellow, A200, A100, A400);
    
    $theme: mat-light-theme($primary, $accent);
    
    @include angular-material-theme($theme);
    
    html,
    body {
      height: 100%;
    }
    body {
      margin: 0;
      font-family: Roboto, 'Helvetica Neue', sans-serif;
      .mat-button-toggle-checked {
        background-color: mat-color($primary);
        color: mat-color($primary, default-contrast);
      }
    }
    

    ps: I assumed you have selected scss and custom theme

提交回复
热议问题