I am trying to reduce the size of mat-raised button. I thought I can reduce the size of the button by reducing the size of the text. But I'm unable to do so.
Here is the CSS:
button {
margin-right: 1vw;
background: #4285F4;
color: white;
font-size: 9px;
height: auto;
width: auto;
}
And the template:
<button mat-raised-button class="button"><span>Click here to submit</span></button>
You can change the height by adding custom styles. You have to change the line-height of the class mat-button-toggle-label-content . Save this answer.
You're on the right track. In addition to font-size you also need to change line-height:
button{
margin-right: 1vw;
background: #4285F4;
color: white;
font-size: 9px;
line-height: 18px;
height: auto;
width: auto;
}
https://stackblitz.com/edit/angular-fmgfn1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With