Hello,

I've been really pleased as to how the ckeditor module is somewhat "smart" about applying a theme's css within the editor. When you choose "use theme css" for the editor css option (admin/settings/ckeditor/edit/profilename) it aggregates all the theme css files it can find... across base and subthemes, etc. This is great.

However, getting your own custom css "overrides", that apply just to the editor (force the background to be white, etc...), is still a bit tricky. Sure you have the config.extraCss js configuration variable, and you can always manually define your own editor css files, but it seems to me that is would be handy if ckeditor automatically looked in your active theme directory for a "ckeditor.css" file, and also factored that in when you choose the "use theme css" option. It already checks for a "ckeditor.css" file in the module directory, so why not look for on in the theme's directory too?

It's nice to have the option to keep everything tied to the active theme, and it's always nice to avoid lots of js customizations and tweaks. I've also found that the config.extraCss js configuration variable has some limitations (see #834228: Need to change background of toolbar dropdowns using theme css & Kama skin) and that there is no easy way to manually set your editor css to be smart about base/subthemes (without defining absolute paths) in the way the "use theme css" option does.

Anyway, the attached (tiny) patch tells ckeditor to also check for a ckeditor.css file in the active theme if the "use theme css" option is selected. Does anyone else see a value in this?

Ryan

CommentFileSizeAuthor
ckeditor_check_theme_dir_for_styles.patch768 bytesrjacobs
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nbchip’s picture

Its good idea. Also its usefull to have option of choosing which of enabled themes u want to be using in editor.

pdcarto’s picture

+1 on being able to choose which theme to have the editor use since many of us use an admin theme for node editing, but want "wysiwyg" to mean what the user sees in the public theme.

dczepierga’s picture

Status: Needs review » Fixed

@rjacobs, thx for patch i commit it to CVS and port also to D7 version.

Please check the latest dev release and let me know if you notice any poblems with it. Remember to clear Drupal cache and browsers cache before testing.

@nbcip, @pdcarto - if u have any feature requests pls create new tickets.

Greetings

mkesicki’s picture

Title: Custom editor css styles - automatically pull from theme's ckeditor.css file? » Add loading ckeditor.css from theme.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.