You are here

function micon_theme_suggestions_micon_icon in Micon 2.x

Same name and namespace in other branches
  1. 8 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 [];
}