Problem/Motivation

Core themes classy, umami, and claro contain an entry in ckeditor_stylesheets called media-embed-error.css to format errors when embedding
This will need consideration for each to port to CKEditor 5, but it makes more sense to add this styling centrally within CKEditor 5.

Steps to reproduce

The effects of the styling can be seen by embedding a media item using CKEditor GUI then editing the source to change the UUID of the media item to something invalid.

Proposed resolution

Remaining tasks

All the things.

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

Comments

Eli-T created an issue. See original summary.

eli-t’s picture

Title: Move media-embed-error class styling from core themes to CKEditor » Move media-embed-error class styling from core themes to CKEditor 5
wim leers’s picture

I would love this. But … can we? Why was this originally done in Classy and not in the Media module? Isn't that the policy?

Note that the media_media plugin that's currently listed in core/modules/ckeditor5/ckeditor5.ckeditor5.yml will eventually be moved to core/modules/media/media.ckeditor5.yml — we can't do that yet because it's not yet stable. But it's already been marked as being provided by the media module, in anticipation of that.

So I think that would mean that this issue would need to move it to the Media module, not the CKEditor 5 module?

Background

The following issues introduced these:

lauriii’s picture

I think we should move this stylesheet in CKEditor 5 from the individual themes to the module. The reason it was part of the themes for CKEditor 4 was at least partially that CKEditor 4 shipped with minimal styling and the individual themes were responsible for adding styles using ckeditor_stylesheets. CKEditor 5 on the other hand is shipping with an opinionated design and therefore it would be good to style the media library error in that same design language and ship it as part of the module.

I think ideally we would also mark the CSS for this as internal, and not copy it to the Stable theme so that it could be changed later on.

wim leers’s picture

#4: So does that mean that you're saying the CKEditor 5 module should continue to own the CKEditor 5 Drupal media integration? Because otherwise it'd be hard to defend this @internal CSS file?

lauriii’s picture

I'm wondering if we should provide generic error styles in the CKEditor 5 module. Something like .ck-widget--error. That could be then used in the Media module. Thoughts on that?

wim leers’s picture

That works for me for sure :) Though I'm not sure how that would help with the template being used?

wim leers’s picture

Ohhhhhhhhhhhhhhhhhhh mea culpa

I thought it was media-embed-error.html.twig that this was referring to — but this issue indeed seems to be only referring to the CSS associated with that template. @Eli-T, can you confirm? 🙏

eli-t’s picture

this issue indeed seems to be only referring to the CSS associated with that template

Yes, that was my intention for this issue.

wim leers’s picture

Oh, perfect!

wim leers’s picture

Status: Active » Closed (outdated)
Related issues: +#3271094: Move Media CKEditor 4 integration into CKEditor

AFAICT this has been fully addressed by #3271094: Move Media CKEditor 4 integration into CKEditor. It's now 100% owned by the media module, not the CKEditor 4/5 modules 👍