You are here

function fontawesome_ckeditor_css_alter in Font Awesome Icons 8

Same name and namespace in other branches
  1. 8.2 fontawesome.module \fontawesome_ckeditor_css_alter()

Implements hook_ckeditor_css_alter().

File

./fontawesome.module, line 49
Drupal integration with Font Awesome, the iconic font for use with Bootstrap.

Code

function fontawesome_ckeditor_css_alter(&$css, $editor) {

  // Attach CSS to CKEditor where appropriate.
  if (\Drupal::config('fontawesome.settings')
    ->get('fontawesome_use_cdn')) {
    $fontawesome_library = \Drupal::service('library.discovery')
      ->getLibraryByName('fontawesome', 'fontawesome.cdn');
  }
  else {
    $fontawesome_library = \Drupal::service('library.discovery')
      ->getLibraryByName('fontawesome', 'fontawesome');
  }
  $css[] = $fontawesome_library['css'][0]['data'];
}