Currently, I am utilizing Angular
, Angular Material
, and css
I'm facing difficulties in reducing the height of the mat-select
Dropdown and achieving proper vertical alignment for the text inside it.
<mat-select class="frequency-dimensions" formControlName="frequency" (change)="disableSubmitButton=false" disableOptionCentering panelClass="custom-panel-frequency">
<mat-option value="daily" selected>Daily</mat-option>
<mat-option value="total">Total</mat-option>
</mat-select>
In my styles.scss
.custom-panel-frequency {
margin: 34px 0px !important;
min-width: 100px !important;
}
The associated scss
defines it as follows..
.frequency-dimensions {
min-width: 100px;
width: 100px;
vertical-align: middle;
}
How can I adjust the height of the Dropdown to around 33px
, align the Dropdown
to the center of the text, and ensure its content is vertically aligned?
The alignment of the Total
Dropdown should match that of the date control depicted below
https://i.sstatic.net/Dclwc.png
UPDATE
Upon reducing the Dropdown height to 25px
, this is how it appears...
https://i.sstatic.net/CEEnS.png
Adjusting margins causes the Dropdown Panel
to shift...
Ultimately, I modified the frequency-dimensions
to...
.frequency-dimensions {
min-width: 100px;
width: 100px;
height: auto;
min-height: auto;
}
These changes resulted in a larger appearance as shown below. My goal is to simply reduce the height without affecting the panel.
https://i.sstatic.net/h4Aas.png
I aim to decrease the height to 75%
of the previous Dropdown
while maintaining proper vertical alignment of its content within the panel..
UPDATE 2
Following the new answer, the Total
Dropdown now appears larger by 25%, which doesn't match the height of the Date Control box.
https://i.sstatic.net/ezA6U.png
UPDATE 3
After reducing the height to 28px
, this is the result..
https://i.sstatic.net/E3BVJ.png
UPDATE 4
Implementing the suggested solution results in the Dropdown displaying like this...
https://i.sstatic.net/f6YNS.png
Any assistance on this matter would be highly appreciated..