Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Personalize button-toggle-group (Material 2)

I have this button group toggle with Material 2 (Angular 5)

<div class="col-md-4">
    <label>Days of Week</label>
    <mat-button-toggle-group multiple formControlName="days_service" #group="matButtonToggleGroup" >
        <mat-button-toggle [value]="days.value" *ngFor='let days of days_service'>
            {{ days.alias }}
        </mat-button-toggle>
    </mat-button-toggle-group>
</div>

This is my button group

But, I'd like to change it to that

like image 474
lesimoes Avatar asked Dec 26 '17 10:12

lesimoes


2 Answers

I solve this problem override the custom directives

mat-button-toggle {
    border: 1px solid #f28628;
    border-radius: 4px;
    margin-left: 3px;
    margin-right:3px;
    width: 30px;
    height: 30px;
    font-family: 'Nunito Semibold', sans-serif;
    font-size: 14px;
    font-style: bold;
}

.mat-button-toggle-disabled {
    border: 1px solid #c5c0c7;
    background-color: #e1dde5;
}

div.center-text {
    margin-left: -8px;
    margin-top: -3px;
}
like image 163
lesimoes Avatar answered Sep 24 '22 01:09

lesimoes


Use below CSS code:

.mat-button-toggle-checked {
   border: 1px solid #c5c0c7;
   background-color: #e1dde5; 
}
like image 25
user1882196 Avatar answered Sep 27 '22 01:09

user1882196