title: Drupal 8 Bootstrap Theme Dropdown on Hover
body: <p>I am working on creating a custom bootstrap theme for Drupal 8 and my goal is to have the main nav menu dropdown child items on hover instead of making the user click, I have found a few suggestions like adding this to my CSS in my theme:</p>
  
  <pre><code>.dropdown:hover .dropdown-menu {
  display: block;
  }
  </code></pre>
  
  <p>And this to my themes .info file:</p>
  
  <pre><code>function YOURTHEME_menu_link(array $variables) {
  $element = $variables['element'];
  $sub_menu = '';
  
  if ($element['#below']) {
  // Prevent dropdown functions from being added to management menu so it
  // does not affect the navbar module.
  if (($element['#original_link']['menu_name'] == 'management') &amp;&amp; (module_exists('navbar'))) {
    $sub_menu = drupal_render($element['#below']);
  }
  else if ((!empty($element['#original_link']['depth'])) &amp;&amp; ($element['#original_link']['depth'] == 1)) {
    // Add our own wrapper.
    unset($element['#below']['#theme_wrappers']);
    $sub_menu = '&lt;ul class="dropdown-menu"&gt;' . drupal_render($element['#below']) . '&lt;/ul&gt;';
    // Generate as standard dropdown.
    $element['#title'] .= ' &lt;span class="caret"&gt;&lt;/span&gt;';
    $element['#attributes']['class'][] = 'dropdown';
    $element['#localized_options']['html'] = TRUE;
  
    // Set dropdown trigger element to # to prevent inadvertant page loading
    // when a submenu link is clicked.
    //$element['#localized_options']['attributes']['data-target'] = '#';
    $element['#localized_options']['attributes']['class'][] = 'dropdown-toggle';
    //$element['#localized_options']['attributes']['data-toggle'] = 'dropdown';
  }
  }
  
  // On primary navigation menu, class 'active' is not set on active menu  item.
  // @see https://drupal.org/node/1896674
  if (($element['#href'] == $_GET['q'] || ($element['#href'] == '&lt;front&gt;' &amp;&amp; drupal_is_front_page())) &amp;&amp; (empty($element['#localized_options']['language']))) {
  $element['#attributes']['class'][] = 'active';
  }
  
  $output = l($element['#title'], $element['#href'],    $element['#localized_options']);
     return '&lt;li' . drupal_attributes($element['#attributes']) . '&gt;' .                                                   $output . $sub_menu . "&lt;/li&gt;\n";
  }
  </code></pre>
  
  <p>But this had no effect on my theme and I still need to click for the dropdown.</p>