1 ckeditor.api.php hook_ckeditor_css_alter(array &$css, $format)

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


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

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

See also


Related topics


core/modules/ckeditor/ckeditor.api.php, line 145
Documentation for CKEditor module APIs.


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