Using @AkberIqbal's solution messed up my styling for mat-form-fields that where not outline. Also this solution does not need any !important;. With !important; you're already lost :D.
So here is a safe way to add to your global styles: (seems overkill, but I rather be save than sorry)
TLDR: adjust the font-size of the surrounding container.
Longer:
The functionality for resizing the form-fields is built into Angular Material so unless you want to change relative proportions in the field, you don't need to get muddy with resizing individual components (see documentation).
The key to adjusting the field size is actually just adjusting the font-size in the surrounding container. Once you do that, everything else will scale with it. e.g.
This isn't a solution for you if you're not happy with the ratio of padding inside the forms. However that's a different question to how you simply resize the forms. Resizing is simple, altering padding and margin ratios is more hairy!
TL;DR Material form fields are based on font-size property of the field.
Don't make the mistake of adjusting material heights, paddling, etc... in your CSS/SCSS... Material Form elements such as input and selects are based on font-size. Also, inline styles are not advised, so you can simply add some CSS. The `appearance attribute is irrelevant.
::ng-deep .mat-form-field {
font-size: 12px; // example
}
A nice work-around mentioned there is to not include a mat-label in your mat-form-field and add this to your css, either local or global. You may need use ::ng-deep.
As many post people has explained, Material angular form-field are based on font-size, so for all of you who want to define a custom form-field, here is my code to resize both height and width without affecting input font or icon toggle size.
Define inside the component css this code and apply them as a class to the mat-form-field label.
Probably the inputs that contain element2 and 'element3 values will resize in height, so to avoid it you need to wrap up into another div (so, the input takes the responsive relative dimensions of the wrapper that do not have flex ) like this code:
i found great soltion for your prolem.
'mat-form-field' is container, 'input' inside,so to change size of input you need to change container size, it will be size of input box,then change input size- its size of font which you use
.small-height-input{
max-height: 46px;
width: 300px;
border-radius: 4px;
font-size: 12px !important;// decrease the font size to set height
.mat-input-element{
font-size: 16px !important; //increase the size of input font
}
}