Can't Change Icon Color inside MenuItem

UI Components for Angular
Post Reply
rafaelpadu
Posts: 2
Joined: 05 Jul 2022, 16:27

30 Nov 2022, 20:22

I having quite a trouble changing the colors of some icons inside a menu. They have two different colors, so i'm passing different classes to them... But (as always) it won't obey...

My menuItemsSet function:

Code: Select all

loadMenuItems(){
    this.menuItems = [
      { label: 'Whatsapp', icon: 'pi pi-whatsapp', iconClass: 'green-icon', command: () => this.openWhatsappHistory(this.selectedItem) },
      { label: 'E-mail', icon: 'pi pi-envelope', iconClass: 'red-icon'},
      { label: 'Excluir', icon: 'pi pi-trash', iconClass: 'red-icon', command: () => this.deleteBudget(this.selectedItem)},
      { label: 'Cancelar', icon: 'pi pi-times',iconClass: 'red-icon', command: () => this.cancelBudget(this.selectedItem)},
    ]
  }
My css:

Code: Select all

.p-menu.p-menuitem-link.p-menuitem-icon.green-icon{
	color: rgb(21, 158, 21) !important;
}

.p-menu.p-menuitem-link.p-menuitem-icon.red-icon{
	color: rgb(242, 66, 66);
}

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 35 guests