Center text in angular material MatButtonToggle

Discussão em 'Angular' iniciado por An-droid, Maio 23, 2025.

  1. An-droid

    An-droid Guest

    I'm trying to customize the MatButtonToggle but have difficulties centering the label :

    [​IMG]

    The template :

    <mat-button-toggle-group name="condition" aria-label="Condition">
    <mat-button-toggle value="and" checked>
    <div>ET</div>
    </mat-button-toggle>
    <mat-button-toggle value="or">OU</mat-button-toggle>
    </mat-button-toggle-group>


    The style :

    .mat-button-toggle-checked {
    background-color: $secondary-color;
    color: white;
    }

    mat-button-toggle-group {
    height: 25px;
    border-radius: 4px;
    border: solid 1px $secondary-color;
    }

    mat-button-toggle {
    font-size: 15px;
    background-color: white;
    color: $secondary-color;
    }


    How can I do that ?

    Continue reading...

Compartilhe esta Página