Search code examples
cssprimeng

How to style the PrimeNg dropdown icon


I am trying to style PrimeNg's dropdown icon.

https://www.primefaces.org/primeng/#/dropdown

Here is how it currently looks and what I'm trying to get it to look like. enter image description here

I'm guessing I have to style the

ui-dropdown-trigger

but I'm not sure what to set it to.

I tried background-color but that didn't work.

Another thing I tried was to just set it as an attribute like:

<p-dropdown ... [styleClass]="{background-color:black}" ...></p-dropdown>

Any ideas?

Edit:

This is how I got the desired output:

  1. Turned off encapsulation (reference)

  2. Added the following code to the css:

    body .ui-dropdown .ui-dropdown-trigger { background-color: #2399E5; color: white; }


Solution

  • I use included bootstrap theme from primeng. So I have to adapt:

    body .ui-dropdown .ui-dropdown-trigger {
        background-color: blue;
    }
    

    in the CSS to colorize the trigger in the theme.