Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
A feature of CKEditor is the ability to add skins, how is this done in Drupal 8?
For example I would like to better match my theme, there are some great skins available (e.g. flat skins).
Comments
Comment #2
Wim LeersComment #3
Wim LeersPinged @mlewand from the CKEditor team with the question
The answer to your question will depend on the CKEditor team's answer to my question :)Comment #4
Jeff Burnz CreditAttribution: Jeff Burnz commentedThanks Wim, thats great, atm I'm using some crazy hacks altering js settings to load styles to make it all work the way I want it to, it would be so much easier if we could load a skin using a library and it just worked :)
Comment #5
Wim Leers@Jeff Burnz Well, worst case, you could create your own custom build of CKEditor. See
core/assets/vendor/ckeditor/build-config.js
. Follow the instructions in there, and change only one thing. Change:to:
Comment #6
Wim Leers… but that'll be a PITA to maintain. Could be a great short-term solution though.
Comment #7
mlewand CreditAttribution: mlewand commentedconfig.skin
option allows you to change the skin. If it's not in the skins directory, you could even provide an external path as a value, more on this in our config.skin documentation.Comment #8
Wim Leers@mlewand came through already as you can see
I've updated https://www.drupal.org/developing/api/8/ckeditor with this information. See the documentation additions: https://www.drupal.org/node/2617470/revisions/view/9775399/9784155.
I do realize this is somewhat painful. If this is a frequent enough request, we can perhaps let themes specify
That'd be a new feature request though.
Comment #9
Jeff Burnz CreditAttribution: Jeff Burnz commentedhook_editor_js_settings_alter()
does not fire in themes.Comment #10
Jeff Burnz CreditAttribution: Jeff Burnz commentedOK, this is totally doable in hook_js_settings_alter(), no idea how this passed me by before, perhaps we should make hook_editor_js_settings_alter() available to themes or document that themes should use hook_js_settings_alter()
Thanks for the push in the right direction guys, very much appreciated!
Comment #11
Wim Leers