This project is not covered by Drupal’s security advisory policy.

CKEditor5 SVG Icon Project Page Banner

Provides functionality for inserting inline SVG's in CKEditor5 using a single sprite.

Note: This module does not add the sprite to your administration theme for previewing. You would need to implement a hook to attach it to your page.

Example:

/**
 * Implements hook_preprocess_html().
 */
function my_module_preprocess_html(&$variables): void {
  if (\Drupal::service('router.admin_context')->isAdminRoute()) {
    $themeExtensionList = \Drupal::service('extension.list.theme');
    $icons = file_get_contents($themeExtensionList->getPath('THEME_NAME') . '/dist/images/icons.svg');
    $variables['page_bottom']['icons'] = [
      '#type' => 'inline_template',
      '#template' => '<span class="d-none icons-sprite">' . $icons . '</span>',
    ];
  }
}

CKEditor5 SVG Icon plugin

Supporting organizations: 
Development

Project information

Releases