I have this structure of html using Angular Material Select
<mat-form-field class="year-drpdwn-vacay-stock">
<mat-select placeholder="Year">
<mat-option>None</mat-option>
<mat-option *ngFor="let yr of year" [value]="yr">{{yr}}</mat-option>
</mat-select>
</mat-form-field>
I placed a class because I also use Select in other components. I tried adding
::ng-deep .mat-select-panel {
margin-top: 20%;
}
in CSS to customize, but the problem is, other components containing another select box also gets affected (inherits the margin-top CSS)
Currently I have this CSS
.year-drpdwn-vacay-stock mat-select.mat-select :host ::ng-deep .mat-select-panel {
margin-top: 20%;
}
But it still doesn't work.
UPDATE
Goal: I want the options panel to move a bit downward upon opening the select box which is why I want .mat-select-panel
to have a top margin of 20%