Closed (fixed)
Project:
Olivero
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
3 Apr 2020 at 14:14 UTC
Updated:
28 Apr 2020 at 13:14 UTC
Jump to comment: Most recent, Most recent file
We need to implement the `ckeditor_stylesheets` library within our `olivero.info.yml` file so that when the CKEditor builds the editor iframe, there are some default theme styling that gets displayed in the CKEditor body field.
Define the stylesheets for the different components/elements that are needed in the CKEditor.
ckeditor_stylesheets:
- css/base/elements.css
- css/components/captions.css
- css/components/table.css
- css/components/text-formatted.css
- css/components/media-embed-error.css| Comment | File | Size | Author |
|---|---|---|---|
| #20 | interdiff_18-20.txt | 317 bytes | boulaffasae |
| #20 | implement_the_ckeditor_stylesheets_library-3124789-20.patch | 13.62 KB | boulaffasae |
| #19 | interdiff_16-18.txt | 13.92 KB | kostyashupenko |
| #19 | 3124789-18.patch | 13.59 KB | kostyashupenko |
| #16 | Снимок экрана 2020-04-10 в 12.52.32.png | 230.7 KB | kostyashupenko |
Comments
Comment #2
proeungComment #3
thejimbirch commentedPatch attached that adds the proposed stylesheets to the ckeditor.
Comment #4
proeung@thejimbirch Thanks for picking up this issue and submitting a patch!
I just wanted to note that we don't currently have the following compiled `.css` file in our theme. In order for the CKeditor to pick up the right styling, we need to extract these into components that can be called in the `ckeditor_stylesheets` property. Please reference the Bartik implementation of exposing body styling within CKeditor. Thanks!
Comment #5
thejimbirch commentedSorry, Misunderstood the Proposed resolution. Will take another look this weekend.
Comment #6
thejimbirch commentedComment #7
proeung@thejimbirch No worries! I appreciate you taking a look at this issue.
Comment #8
kostyashupenkoComment #9
mherchelDebug code.
This library never loads because Olivero is not active (and thus cannot extend or override a library). Is there another way to add the CSS class onto the body tag of CKeditor's iframe while in an administrative theme? I'm honestly not sure.
We might have to add a
.cke_editableclass to go along with the.text-contentclass within our CSS. I really don't know of another way to solve this.Comment #10
kostyashupenkoImproved ckeditor styles and content styles in ckeditor-iframe, check the screen:

1.
console.logwas removed of course2.
Answering:
- What do you mean under "library never loads because Olivero is not active"?
- I don't know if there is some other way to add
text-contentto the body, since not much hooks here. What's the problem actually with that js? :)I don't think it is good thing btw to add
cke_editableselector intotext-content.cssComment #11
kostyashupenkoYou don't like it is wrapped by drupal behavior?
Comment #12
mherchelNo, the issue is that the JS doesn't load for me, and so the text-content class is never added to the CKEditor iframe body,
Comment #13
kostyashupenkowhich drupal version do you test?
With this issue on my side it's Drupal 8.9.x, standard profile
Comment #14
kostyashupenkoHm.. but that library still exist even in 9.0.x https://git.drupalcode.org/project/drupal/-/blob/9.0.x/core/modules/cked...
Comment #15
kostyashupenkoI tested my patch against 9.1.x and it is still ok for admin/non-admin user, check my screen

Comment #16
kostyashupenkoJust a reroll
Comment #17
mherchelI'm seeing the stylesheets being pulled in, and its starting to look good. However, the
text-contentCSS class is never added to the ckeditor iframe'sbodyelement because the Olivero theme is not active when CKEditor loadDoes this make sense?
Comment #18
kostyashupenkoWell, true...
1. libraries-extend for ckeditor/drupal.ckeditor was removed
2. js file removed
3. selector `cke_editable` added into text-content.css. Sad we don't use postcss-extend plugin (
4. some little improvements done with styles.
Comment #19
kostyashupenkoComment #20
boulaffasae commentedHi kostyashupenko, mherchel
in Firefox Fonts tab it show DejaVu Serif as the used font, so i tried to add
css/dist/base/fonts.cssto the ckeditor_stylesheets.Is it right ?
Comment #21
kostyashupenkoGood catch @boulaffasae, yes it is right
Comment #22
mherchelLooking good!
This stylesheet in dist looks like it's left over from a previous patch. I'm omitting it from the commit.
Comment #23
mherchelCommitted! Thanks everyone!