Score:1

Use CSS preprocessor on CKEditor 4 contextmenu

iq flag

I had to customize the look and feel of the CKEditor 4 context menu for our (internal use only) module. So, I copied core/assets/vendor/ckeditor/skins/moono-lisa/editor.css to my_module/css/contextmenu.css, I changed it to my liking, and then I added the following line in src/Plugin/CKEditorPlugin/CustomInternal.php:

    $config['contextmenu_contentsCss'] = '/CLS/modules/custom/my_module/css/contextmenu.css' ;

This works, but since the menu is in a iframe of its own if I change the css it's very hard to pick up the new version, even with Ctrl-F5.

In production I never have problems with changes to CSS or JS because the preprocessor generates unique names of the processed files at every change. Can I use it to manage this file, somehow? I suppose I'd have to make the source CSS file visible to the preprocessor, get the name of the processed file, and then add it dynamically to the CKEditor configuration... not so simple, I guess. Any better idea?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.