Closed (fixed)
Project:
Drupal core
Version:
9.5.x-dev
Component:
ckeditor.module
Priority:
Critical
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
10 Jun 2022 at 11:42 UTC
Updated:
3 Feb 2023 at 12:22 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
lauriiiI'm personally in favor of option 1. In its simplest form, it should be simple to implement and maintain. It would also be consistent with what we are aiming to do with CKEditor 5.
Comment #3
wim leersActually … are we moving it to contrib? 🤔 Should we? CKEditor 4's security support will end, so …
💯
Comment #4
lauriiiLinking to the issue which states that CKEditor 4 would be moved to contrib since I believe that would be a good place to discuss that.
Comment #5
catchFor Bartik and Seven, it seems easiest to leave the CSS in the respective themes which will also be moving to contrib, then the contrib themes can provide support for the contrib module. Then Claro and Olivero CSS could be dropped when ckeditor4 is moved out.
Having said that option #1 sounds good if it's not too much effort.
Comment #6
lauriii#5 seems reasonable given that the styles are related to minor adjustments to make the editor content resemble the frontend theme styles. All of the CSS that is required for the editor to remain functional is already in the CKEditor module, including the styles to make the CKEditor functional in Off Canvas.
Comment #7
nod_Not sure I understand what option 1 means. It would be sort of a normalize.css for CKE content when there is no CSS declared? how is that different to leaving everything to CKE4 default styles? are the CKE4 default styles not good enough?
Comment #8
lauriii@nod_ I think the normalize.css analogy is pretty accurate. I don't think we necessarily need to do anything. It is just that the styles are pretty basic and rely on browser default styles. Even though I proposed adding some default CSS, I don't think it would be strictly required and I think we would be most definitely fine with the default styles.
Olivero before:

Olivero after:

Comment #9
nod_Thanks for the explanation.
Givent that I'd add normalize.css in CKE by default and stop there. All the core themes depend on it so that would make for a good default baseline IMO
Comment #10
lauriiiAdded option 4 from #5 which I think is the most straight forward to implement.
Comment #11
nod_About the files that are not inside the CKE iframe editor here is a list of what's happening in core themes regarding CKE libraries extension/overrides:
Classy
Bartik
Same override as classy
Claro
Only CSS additions + the classy copy/paste
The CSS is used to make sure the CKE area has focus styles in the content editing, that the CKE dialogs follow the claro theme and not the default CKE styling, and to add a focus style to the CKE text format admin interface.
Olivero
Single CSS addition
Seven
Couple of CSS extension + the classy copy/paste
Focus styles for editor buttons in the text format admin interface + CKE dialog styling
Stable
Bunch of CSS files overrides, custom CKE theme based on CKE "moono"
CSS files are copy/paste from the CKE module. I guess it's to make sure stable is indeed stable should the CKE module CSS change.
There is one addition to ckeditor.css, stable adds a rule for CKE styling when used with quickedit.
Stable 9
Bunch of CSS files overrides, same as Stable theme. CSS is the same as the stable theme.
Comment #12
lauriii@nod_ did you have a chance to reassess what those libraries are altering? That would likely impact how we'd like to approach removing them.
Comment #13
nod_added some details in the comment above. Most rules are about styling the CKE dialogs, and there are a couple of rules to make sure the focus is styled in a couple of cases.
Comment #14
lauriiiWe should check if the CKE dialogs are usable without styles from themes.
It also sounds like, we might have to add few lines of CSS to the CKEditor module to ensure that the focus styles are accessible even without the CSS additions from themes.
Comment #15
nod_the dialogs are very much usable without the styles overrides, just pretty different visually than the rest of the themes.
Comment #16
lauriiiHere's a patch which we could use for ensuring that there's a visible focus outline. It seems like for example FF is missing focus outline at the moment when not using Claro or Seven.
Comment #17
nod_That works for the admin config interface, still missing focus style when using the cke in an edit form.
Comment #18
lauriiiFor #17.
Comment #19
lauriiiComment #20
nod_That works for me, this also adds a focus style to CKE4 on olivero (wrong color for olivero but better than nothing) :)
Comment #21
bnjmnmOn HEAD, with FF and Chrome, I tested button focus in the admin form with every core theme (including Stark and Classy) and the focus ring was visible in each. I'm not sure this is necessary for the admin form, I may be missing something here...
It was mentioned in an earlier comment that it was noticed FF wasn't getting focus rings in some themes, but the color here is not recognized by FF. The color on the dash outline isn't that distinct from the borders.
I agree with @nod_ that dialogs look fine and are plenty usable without the theme styling:

Comment #22
lauriii#21.1: It is needed to make the focus ring visible on Claro.
Here's a patch that improves the FF focus ring:
Comment #23
nod_I'm happy with it. Resolves an issue in olivero too so extra bonus :)
Comment #24
lauriiiRemoving the needs product/release manager review tags since I originally tagged this with those tags. I think the scope of this was smaller than I anticipated and I believe we don't need reviews from them besides what we already got in #5.
Comment #27
bnjmnmCommitted to 10.1.x and cherry picked to 10.0.x and 9.5.x.
This is a nice solution as it acknowledges that CKEditor 4 is near EOL / Core exclusion so it does not attempt to provide a pixel-perfect means of continuing use of an EOL, but it does address issues that would compromise accessibility / feature access.
Comment #30
leo liao commentedCursor is blocked on chrome.
Comment #31
leo liao commentedComment #32
bnjmnm@leo liao If you're hoping to see this change added to Drupal core it's best to create a new issue. It won't see any progress added to something that was closed several months ago.