WordPress.org

Making WordPress.org

Changeset 3418


Ignore:
Timestamp:
06/17/2016 04:45:49 PM (5 years ago)
Author:
obenland
Message:

Plugin Directory: Highlight current menu item.

See #1719.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/css/style-rtl.css

    r3406 r3418  
    12791279}
    12801280
    1281 .main-navigation a.active, .main-navigation .single .type-plugin .entry-content .active.section-toggle, .single .type-plugin .entry-content .main-navigation .active.section-toggle {
    1282   border-color: rgba(255, 255, 255, 0.2);
     1281@media screen and (min-width: 48em) {
     1282  .main-navigation a.active, .main-navigation .single .type-plugin .entry-content .active.section-toggle, .single .type-plugin .entry-content .main-navigation .active.section-toggle {
     1283    border-bottom: 1px solid;
     1284  }
    12831285}
    12841286
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/css/style.css

    r3406 r3418  
    12791279}
    12801280
    1281 .main-navigation a.active, .main-navigation .single .type-plugin .entry-content .active.section-toggle, .single .type-plugin .entry-content .main-navigation .active.section-toggle {
    1282   border-color: rgba(255, 255, 255, 0.2);
     1281@media screen and (min-width: 48em) {
     1282  .main-navigation a.active, .main-navigation .single .type-plugin .entry-content .active.section-toggle, .single .type-plugin .entry-content .main-navigation .active.section-toggle {
     1283    border-bottom: 1px solid;
     1284  }
    12831285}
    12841286
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/header.php

    r3393 r3418  
    1111
    1212namespace WordPressdotorg\Plugin_Directory\Theme;
     13
     14$menu_items = array(
     15    '/browse/favorites/' => __( 'Favorites', 'wporg-plugins' ),
     16    '/browse/beta/'      => __( 'Beta Testing', 'wporg-plugins' ),
     17    '/about/'            => __( 'Developers', 'wporg-plugins' ),
     18);
    1319
    1420$GLOBALS['pagetitle'] = __( 'Plugin Directory — Free WordPress Plugins', 'wporg-plugins' );
     
    3440                    <div id="primary-menu" class="menu">
    3541                        <ul>
    36                             <li class="page_item"><a href="<?php echo esc_url( home_url( 'browse/favorites/' ) ); ?>"><?php esc_html_e( 'Favorites', 'wporg-plugins' ); ?></a></li>
    37                             <li class="page_item"><a href="<?php echo esc_url( home_url( 'browse/beta/' ) ); ?>"><?php esc_html_e( 'Beta Testing', 'wporg-plugins' ); ?></a></li>
    38                             <li class="page_item"><a href="<?php echo esc_url( home_url( 'about/' ) ); ?>"><?php esc_html_e( 'Developers', 'wporg-plugins' ); ?></a></li>
     42                            <?php
     43                            foreach ( $menu_items as $path => $text ) :
     44                                $class = false !== strpos( $_SERVER['REQUEST_URI'], $path ) ? 'class="active" ' : '';
     45                            ?>
     46                            <li class="page_item"><a <?php echo $class; ?>href="<?php echo esc_url( home_url( $path ) ); ?>"><?php echo esc_html( $text ); ?></a></li>
     47                            <?php endforeach; ?>
    3948                            <li><?php get_search_form(); ?></li>
    4049                        </ul>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/sass/navigation/_menus.scss

    r3261 r3418  
    7575        }
    7676
    77         &.active {
    78             border-color: rgba( 255, 255, 255, 0.2 );
     77        @media screen and (min-width: $ms-breakpoint) {
     78            &.active {
     79                border-bottom: 1px solid;
     80            }
    7981        }
    8082    }
Note: See TracChangeset for help on using the changeset viewer.