Make WordPress Core

Changeset 38909


Ignore:
Timestamp:
10/25/2016 04:50:49 PM (8 years ago)
Author:
karmatosed
Message:

Twenty Seventeen: Display scroll down arrow when no menu

This improves scrollability without a menu.

Props nnaimov, melchoyce, davidakennedy
Fixes #38392

Location:
trunk/src/wp-content/themes/twentyseventeen
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyseventeen/assets/js/global.js

    r38886 r38909  
    1111            $navMenuItem = $navigation.find( '.menu-item' ),
    1212            $menuToggle = $navigation.find( '.menu-toggle' ),
    13             $menuScrollDown = $navigation.find( '.menu-scroll-down' ),
     13            $menuScrollDown = $body.find( '.menu-scroll-down' ),
    1414            $sidebar = $body.find( '#secondary' ),
    1515            $entryContent = $body.find( '.entry-content' ),
     
    144144
    145145        // Let's fire some JavaScript!
    146         if ( 'true' === twentyseventeenScreenReaderText.has_navigation ) {
     146        if ( $menuScrollDown.length ) {
    147147
    148148            /**
  • trunk/src/wp-content/themes/twentyseventeen/style.css

    r38892 r38909  
    14651465/* Scroll down arrow */
    14661466
    1467 .navigation-top .menu-scroll-down {
     1467.site-header .menu-scroll-down {
    14681468    display: none;
    14691469}
     
    35153515    }
    35163516
    3517     .site-navigation-fixed.navigation-top .menu-scroll-down {
     3517    .site-navigation-fixed.site-header.menu-scroll-down {
    35183518        display: none;
    35193519    }
     
    35213521    /* Scroll down arrow */
    35223522
    3523     .navigation-top .menu-scroll-down {
    3524         color: #767676;
     3523    .site-header .menu-scroll-down {
    35253524        display: block;
    35263525        padding: 0.5em 0.5em 0.4em;
    35273526        position: absolute;
    35283527        right: 0;
    3529         top: 0.9em;
    35303528        -webkit-transform: rotate(90deg); /* Chrome, Safari, Opera */
    35313529        -ms-transform: rotate(90deg); /* IE 9 */
    35323530        transform: rotate(90deg);
     3531    }
     3532
     3533    .site-header .menu-scroll-down {
     3534        color: #fff;
     3535        top: 2em;
     3536    }
     3537
     3538    .site-header .navigation-top .menu-scroll-down {
     3539        color: #767676;
     3540        top: 0.9em;
    35333541    }
    35343542
  • trunk/src/wp-content/themes/twentyseventeen/template-parts/header/site-branding.php

    r38872 r38909  
    2828        </div><!-- .site-branding-text -->
    2929
     30        <?php if ( ( twentyseventeen_is_frontpage() || ( is_home() && is_front_page() ) ) && ! has_nav_menu( 'top' ) ) : ?>
     31        <a href="#content" class="menu-scroll-down"><?php echo twentyseventeen_get_svg( array( 'icon' => 'next' ) ); ?><span class="screen-reader-text"><?php _e( 'Scroll Down', 'twentyseventeen' ); ?></span></a>
     32    <?php endif; ?>
     33
    3034    </div><!-- .wrap -->
    3135</div><!-- .site-branding -->
Note: See TracChangeset for help on using the changeset viewer.