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 default padding of the material forms. However that's a different question to how you simply resize the forms. Resizing is simple, altering padding etc. is more hairy!
In case someone wants to make Akber Iqbal's answer class-based(to have both sizes available):
Hopefully, the Angular team adds support for high-density UI in future releases(high-density is part of material design specifications).
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)
So as you can see. I "hunt" down every class until I have found a outline! I like outline styling to only be applied to outline-fields.
Add these to your CSS in the your original stackblitz
UPDATED: with transition for the label...
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.
With container font-size: 12px;
Resultant form:
With container font-size: 18px;
Resultant form:
NB
This isn't a solution for you if you're not happy with the default padding of the material forms. However that's a different question to how you simply resize the forms. Resizing is simple, altering padding etc. is more hairy!
Here is a recent solution of mine for a field that is 32px tall and allows for rounded corners.