A common use case for sites we build is that only site managers have access to wysiwyg editors. The module includes ckeditor.css in hook init -- not aggregated no less -- which results in a superfluous stylesheet request for every page request.
Move ckeditor.css inclusion into '#attached', or with drupal_add_css the first time editor elements are included on a page, rather than using hook init. Also if you continue to use drupal_add_css, at least specify it should be aggregated.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | ckeditor-hook-init.patch | 455 bytes | fearlsgroove |
Comments
Comment #1
fearlsgroove commentedHere's a band-aid patch that at least preprocesses the css (i haven't actually tested this, sorry for being lazy :)
Comment #2
wwalc commentedThe rte* styles should be left in ckeditor.css and appended to every page (because they're used to style the content when align/justify buttons are used). The rest of styles (especially the one from "toolbar Drag & Drop" group) should be definitely added to the site only when needed. So the right way to go would be to split styles into at least two files.
Regarding the patch - according to the documentation, preprocess is set to TRUE if not specified, so the patch does not change anything. A quick test confirmed that CSS files are aggregated properly.
Comment #3
devin carlson commentedMarking this as a duplicate of the older #1370894: Conditionally load ckeditor.css only when necessary.