I have been working with PrimeNG as the UI library to an Angular TypeScript application I have been developing and I have been having trouble customizing the font size styling and the dropdown trigger icon styling of the PrimeNG dropdown that I have put together. It seems the styling documentation for PrimeNG is rather vague on how to customize it.
No matter how I try to adjust it, the font size does not change within the dropdown. I am not sure if I should use the inline style in html, a property in TypeScript, or override the PrimeNG CSS styling to accomplish this. This also goes for the Dropdown Trigger icon.
Here is my HTML, TypeScript, and CSS.
<p-dropdown [options]="heights" [style]="{'font-size':'12px'}" [(ngModel)]="height" (ngModelChange)="adjustHeight()">
</p-dropdown>
heights: SelectItem[] = [
{label: 'Table Size: Small', value: 'Small'},
{label: 'Table Size: Large', value: 'Large'}
];
.p-dropdown {
font-size: 12px !important;
}
.p-dropdown-trigger {
font-size 12px !important
}
Update: Using what was suggested below and a simple adjustment to the style class referred to in PrimeNG I was able to change the font size of the text in a p-dropdown with:
:host ::ng-deep .p-dropdown-label {
font-size: 12px !important;
}