How to add icons to a menu? I use Drupal 8. 

I would simply want to add icons to one of the menus with a &lt;span&gt;. 

Have you runways?
This is how I'm doing it for dropdown operations(Font Awesome icons).

/**
 * Implements hook_preprocess_links().
 */
function HOOK_preprocess_links(array &amp;$variables) {
  if (stripos($variables['theme_hook_original'], 'links__dropbutton__operations') === 0) {
    $variables['attributes']['class'][] = 'menu';
    $links = &amp;$variables['links'];
    foreach ($links AS $key =&gt; &amp;$link) {
      switch (Html::getClass($key)) {
        case 'view';
        case 'canonical':
          $icon = 'eye';
          break;

        case 'edit':
          $icon = 'pencil';
          break;

        case 'delete':
          $icon = 'trash';
          break;

        case 'clone':
          $icon = 'clone';
          break;

        case 'add':
        case 'create':
        $icon = 'plus';
          break;

        case 'manage-fields':
          $icon = 'list';
          break;

        case 'manage-form-display':
          $icon = 'server';
          break;

        case 'manage-display':
          $icon = 'th';
          break;

        case 'devel':
          $icon = 'code';
          break;

        case 'pay':
          $icon = 'money';
          break;

        case 'enable':
          $icon = 'toggle-off';
          break;

        case 'disable':
          $icon = 'toggle-on';
          break;

        default:
          $icon = 'question';
          break;
      }

      $link['link']['#title'] = [
        '#type' =&gt; 'inline_template',
        '#template' =&gt; '&lt;i class="fa fa-{{ icon }}" title="{{ title }}"&gt;&lt;/i&gt;&lt;span class="visually-hidden"&gt;{{ title }}&lt;/span&gt;',
        '#context' =&gt; [
          'title' =&gt; $link['link']['#title'],
          'icon' =&gt; $icon
        ]
      ];
    }
  }
}