You are here

function hook_ckeditor_css_alter in CKEditor for WYSIWYG Module 8

Same name and namespace in other branches
  1. 7 ckeditor.api.php \hook_ckeditor_css_alter()

Modify the list of CSS files that will be added to a CKEditor instance.

Modules may use this hook to provide their own custom CSS file without providing a CKEditor plugin. This list of CSS files is only used in the iframe versions of CKEditor.

Note that because this hook is only called for modules and the active theme, front-end themes will not be able to use this hook to add their own CSS files if a different admin theme is active. Instead, front-end themes and base themes may specify CSS files to be used in iframe instances of CKEditor through an entry in their .info file:

ckeditor_stylesheets[] = css / ckeditor - iframe . css;

Parameters

$css: An array of CSS files, passed by reference. This is a flat list of file paths relative to the Drupal root.

$editor: The editor object as returned by editor_load(), for which these files are being loaded.

$format: The corresponding text format object as returned by filter_format_load() for which the current text editor is being displayed.

See also

_ckeditor_theme_css()

1 invocation of hook_ckeditor_css_alter()
CKEditor::getJSSettings in lib/Drupal/ckeditor/Plugin/editor/editor/CKEditor.php
Implements \Drupal\editor\Plugin\EditorInterface::getJSSettings().

File

./ckeditor.api.php, line 118
Documentation for CKEditor module APIs.

Code

function hook_ckeditor_css_alter(array &$css, $editor, $format) {
  $css[] = drupal_get_path('module', 'mymodule') . '/css/mymodule-ckeditor.css';
}