You are here

function micon_theme_suggestions_micon_icon in Micon 8

Same name and namespace in other branches
  1. 2.x micon.module \micon_theme_suggestions_micon_icon()

Implements hook_theme_suggestions_HOOK().

File

./micon.module, line 73
Contains micon.module.

Code

function micon_theme_suggestions_micon_icon(array $variables) {
  $icon = $variables['icon'];
  if (is_string($icon)) {
    $icon = \Drupal::service('micon.icon.manager')
      ->getIconMatch($icon);
  }
  if ($icon instanceof MiconIconInterface) {
    return [
      'micon_icon__' . $icon
        ->getType(),
    ];
  }
  return [];
}