I am looking for a way to dynamically set the height of a select element by passing a variable, but the height is currently a constant in the material code (select.ts).
Check out the mat-select documentation
View the source code on Github: material2 / select.ts
Is there any way to override this constant using providers or any other method?
I have come across solutions involving custom css styling:
1. Utilizing ::ng-deep
2. Using ViewEncapsulation
3. Setting class styles in style.css and using !important
4. Implementing panelClass
However, since these solutions involve css, could they potentially lead to css pollution?
::ng-deep .mat-option{
height: 2.5em;
}
mat-option{
height: 2.5em !important;
}
In conclusion, if I cannot override the constant in select.ts, should I be concerned about potential issues arising from using CSS in the future, or would it be acceptable in my situation?