swisnl / jQuery-contextMenu

jQuery contextMenu plugin & polyfill
https://swisnl.github.io/jQuery-contextMenu/
MIT License
2.25k stars 744 forks source link

Cannot change fontawesome icons color #741

Closed crystalfp closed 3 years ago

crystalfp commented 3 years ago

I'm included fontawesome .js file in my application using jquery-contextmenu V3.0.0-beta2 and can add icons to menu entries without problems. For example:

delete: {
    name: "Delete",
    callback: function(key: Event, opt: string) {console.log(`Clicked on ${opt}`);},
    icon: "fa-trash-alt"
},

The problem is they came out blue and there is no way to change this color. The suggested method, that is, changing in CSS:

.context-menu-icon {
  color: red;
}

changes the text color, but not the icon color. Also seems that context-menu-icon is redundant compared to context-menu-item: there is no style for icon separated from the text style. Thanks for looking! mario

crystalfp commented 3 years ago

In the Chrome inspector if I change the following entry the color changes:

.context-menu-icon.context-menu-icon--fa::before {
  color: #b929b9;
}

So putting it in my CSS file does change the icon color.