问题
How do I set plugin and/or widget toolbar button icon using class names (instead of using image URL)?
回答1:
I've found a hack for this seemingly obvious missing feature:
editor.ui.addButton('MyButton', {
//className: '...' // this only adds the classes to the parent container, not the icon span
icon: '_ fa fa-scissors _' // this hacks the existing classes and injects extra classes to the icon span
});
Tested with CK Editor v4.6.2
来源:https://stackoverflow.com/questions/41620593/set-plugin-toolbar-icon-using-class-names-in-ck-editor