Skip to content

Commit

Permalink
mobile nav toggle refactored
Browse files Browse the repository at this point in the history
now toggling the whole top bar instead of a the mobile nav inside the 
top-bar-right according to the foundation-sites docs
https://foundation.zurb.com/sites/docs/top-bar.html
  • Loading branch information
derweili committed Mar 1, 2019
1 parent 4b52ec9 commit 1e9a5ad
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</div>
</div>

<nav class="site-navigation top-bar" role="navigation">
<nav class="site-navigation top-bar" role="navigation" id="<?php foundationpress_mobile_menu_id(); ?>">
<div class="top-bar-left">
<div class="site-desktop-title top-bar-title">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
Expand Down
4 changes: 2 additions & 2 deletions library/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ function foundationpress_top_bar_r() {
wp_nav_menu(
array(
'container' => false,
'menu_class' => 'dropdown menu',
'items_wrap' => '<ul id="%1$s" class="%2$s desktop-menu" data-dropdown-menu>%3$s</ul>',
'menu_class' => 'dropdown menu desktop-menu',
'items_wrap' => '<ul id="%1$s" class="%2$s" data-dropdown-menu>%3$s</ul>',
'theme_location' => 'top-bar-r',
'depth' => 3,
'fallback_cb' => false,
Expand Down
8 changes: 1 addition & 7 deletions src/assets/scss/modules/_navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.site-title-bar {
@include hide-for(medium);
}

//
.desktop-menu,
.site-navigation .top-bar-left {
@include show-for(medium);
Expand All @@ -14,12 +14,6 @@
font-weight: bold;
}

// Mobile menu
.mobile-menu {
display: none; // prevents repaint caused by JS hiding menu onload
}


// WP post navigation
.post-navigation {
@include clearfix;
Expand Down
2 changes: 1 addition & 1 deletion template-parts/mobile-top-bar.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

?>

<nav class="mobile-menu vertical menu" id="<?php foundationpress_mobile_menu_id(); ?>" role="navigation">
<nav class="mobile-menu vertical menu" role="navigation">
<?php foundationpress_mobile_nav(); ?>
</nav>

0 comments on commit 1e9a5ad

Please sign in to comment.