CSS is not loaded w/ CKEditor 5

Created on 6 February 2023, almost 2 years ago
Updated 19 March 2023, over 1 year ago

The module's CSS is not being loaded when CKEditor 5 is used. This appears to be because the module uses hook_ckeditor_css_alter to add the CSS. CKEditor 5 does not load in an iframe so that hook is no longer used.

The CSS could instead now be loaded with attach_library in the Twig template.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States pcate

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Issue created by @pcate
  • πŸ‡ΊπŸ‡ΈUnited States luke.leber Pennsylvania

    Thanks for the bug report. I have not used ckeditor5 on any live client sites yet personally. Out of curiosity, if a media entity exists on page load is the style loaded then?

    The library definitions are present in the field formatter's viewElements method, so I am wondering if the cke5 integration may not be bubbling things properly?

  • πŸ‡ΊπŸ‡ΈUnited States pcate

    Out of curiosity, if a media entity exists on page load is the style loaded then?

    Yes, on the node view page the styles are loaded fine. It is only on the node edit pages in CKEditor5 that the styles aren't loading.

    My guess is the styles will need to be loaded with a CKEditor5 yaml plugin file: https://www.drupal.org/docs/drupal-apis/ckeditor-5-api/overview β†’

  • @lukeleber opened merge request.
  • Status changed to Needs review almost 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States luke.leber Pennsylvania

    I've reached out to the experts in #ckeditor5 on slack with the approach in the merge request. Setting (optimistically) to NR :-).

  • Status changed to Fixed over 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024