WordPress.org

Making WordPress.org

Changeset 3200


Ignore:
Timestamp:
05/20/2016 09:01:31 PM (6 years ago)
Author:
obenland
Message:

Plugin Directory: Tighten up Widget setup and styles.

  • Removes the use of dynamic sidebars and makes information strings translatable.
  • Unifies widget styles across front page and single plugin pages.

See #1719.

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

Legend:

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

    r3199 r3200  
    10751075.widget {
    10761076  margin: 0 0 1.5em;
     1077}
     1078
     1079.home .widget-area {
     1080  margin: 0 auto;
     1081  max-width: 960px;
     1082  padding: 0 1.5625rem 3.0517578125rem 1.5625rem;
     1083}
     1084
     1085@media (min-width: 67rem) {
     1086  .home .widget-area {
     1087    padding: 0 0 3.0517578125rem 0;
     1088  }
     1089}
     1090
     1091.home .widget-area .widget {
     1092  display: inline-block;
     1093  font-size: 12.8px;
     1094  font-size: 0.8rem;
     1095  margin-right: 5%;
     1096  vertical-align: top;
     1097  width: 30%;
    10771098  /* Make sure select elements fit in widgets. */
    10781099}
    10791100
    1080 .widget select {
     1101.home .widget-area .widget:last-child {
     1102  margin-right: 0;
     1103}
     1104
     1105.home .widget-area .widget select {
    10811106  max-width: 100%;
    10821107}
     
    14311456}
    14321457
    1433 .single .type-plugin .entry-meta .plugin-ratings, .single .type-plugin .entry-meta .stars__small {
    1434   margin-bottom: 1rem;
    1435 }
    1436 
    14371458.single .type-plugin .entry-meta .plugin-ratings .description, .single .type-plugin .entry-meta .stars__small .description {
    14381459  font-size: 12.8px;
     
    15591580## Widgets
    15601581--------------------------------------------------------------*/
     1582.widget {
     1583  margin: 0 0 1.5em;
     1584}
     1585
    15611586.home .widget-area {
    15621587  margin: 0 auto;
     
    15651590}
    15661591
     1592@media (min-width: 67rem) {
     1593  .home .widget-area {
     1594    padding: 0 0 3.0517578125rem 0;
     1595  }
     1596}
     1597
    15671598.home .widget-area .widget {
    15681599  display: inline-block;
    1569   width: 30%;
    1570   margin-right: 5%;
    15711600  font-size: 12.8px;
    15721601  font-size: 0.8rem;
     1602  margin-right: 5%;
     1603  vertical-align: top;
     1604  width: 30%;
    15731605  /* Make sure select elements fit in widgets. */
    15741606}
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/front-page.php

    r3193 r3200  
    3636                    endwhile;
    3737                ?>
    38 
    3938            </section>
    4039
     
    4342    </main><!-- #main -->
    4443
     44    <aside id="secondary" class="widget-area" role="complementary">
     45        <?php
     46            $widget_args = array(
     47                'before_title' => '<h4 class="widget-title">',
     48                'after_title'  => '</h4>',
     49            );
     50
     51            the_widget( 'WP_Widget_Text', array(
     52                'title' => __( 'Plugin Authors', 'wporg-plugins' ),
     53                'text'  => __( 'Now what are the possibilities of warp drive? Cmdr Riker\'s nervous system has been invaded by an unknown microorganism. The organisms fuse to the nerve, intertwining at the molecular level. That\'s why the transporter\'s biofilters couldn\'t extract it.', 'wporg-plugins' ),
     54            ), $widget_args );
     55
     56            the_widget( 'WP_Widget_Text', array(
     57                'title' => __( 'Plugin Reviewers', 'wporg-plugins' ),
     58                'text'  => __( 'Shields up. I recommend we transfer power to phasers and arm the photon torpedoes. Something strange on the detector circuit. The weapons must have disrupted our communicators.', 'wporg-plugins' ),
     59            ), $widget_args );
     60
     61            the_widget( 'WP_Widget_Text', array(
     62                'title' => __( 'Plugin Handbook', 'wporg-plugins' ),
     63                'text'  => __( 'Communication is not possible. The shuttle has no power. Using the gravitational pull of a star to slingshot back in time? We are going to Starbase Montgomery for Engineering consultations prompted by minor read-out anomalies.', 'wporg-plugins' ),
     64            ), $widget_args );
     65        ?>
     66    </aside><!-- #secondary -->
    4567<?php
    46 get_sidebar( 'front-page' );
    4768get_footer();
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php

    r3196 r3200  
    6161
    6262/**
    63  * Register widget area.
    64  *
    65  * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
    66  */
    67 function widgets_init() {
    68 
    69     register_sidebar( array(
    70         'name'          => esc_html__( 'Front Page Sidebar', 'wporg-plugins' ),
    71         'id'            => 'sidebar-front-page',
    72         'description'   => esc_html__( 'Appears on the bottom of the front page.', 'wporg-plugins' ),
    73         'before_widget' => '<div id="%1$s" class="widget %2$s">',
    74         'after_widget'  => '</div>',
    75         'before_title'  => '<h4 class="widget-title">',
    76         'after_title'   => '</h4>',
    77     ) );
    78 
    79     register_sidebar( array(
    80         'name'          => esc_html__( 'Sidebar', 'wporg-plugins' ),
    81         'id'            => 'sidebar-1',
    82         'description'   => esc_html__( 'Add widgets here.', 'wporg-plugins' ),
    83         'before_widget' => '<div id="%1$s" class="widget %2$s">',
    84         'after_widget'  => '</div>',
    85         'before_title'  => '<h3 class="widget-title">',
    86         'after_title'   => '</h3>',
    87     ) );
    88 }
    89 add_action( 'widgets_init', __NAMESPACE__ . '\widgets_init' );
    90 
    91 /**
    9263 * Enqueue scripts and styles.
    9364 */
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/sass/site/_site.scss

    r3193 r3200  
    3434## Widgets
    3535--------------------------------------------------------------*/
    36 @import "secondary/front-page";
     36@import "secondary/widgets";
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/sass/site/primary/_plugin-single.scss

    r3193 r3200  
    8484
    8585        .plugin-ratings {
    86             margin-bottom: 1rem;
    87 
    8886            .description {
    8987                @include font-size( ms-unitless( ms(-2) ) );
     
    9997            }
    10098        }
     99
    101100        .stars__small {
    102101            @extend .plugin-ratings;
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/sass/site/secondary/_widgets.scss

    r3193 r3200  
     1@import "../../variables-site/variables-site";
     2@import "../../mixins/mixins-master";
     3
    14.widget {
    25    margin: 0 0 1.5em;
     6}
    37
    4     /* Make sure select elements fit in widgets. */
    5     select {
    6         max-width: 100%;
     8.home .widget-area {
     9    margin: 0 auto;
     10    max-width: $size__site-main;
     11    padding: 0 ms(4) ms(10) ms(4);
     12
     13    @media ( min-width: 67rem ) {
     14        padding: 0 0 ms(10) 0;
     15    }
     16
     17    .widget {
     18        display: inline-block;
     19        @include font-size( ms-unitless( ms(-2) ) );
     20        margin-right: 5%;
     21        vertical-align: top;
     22        width: 30%;
     23
     24        &:last-child {
     25            margin-right: 0;
     26        }
     27
     28        /* Make sure select elements fit in widgets. */
     29        select {
     30            max-width: 100%;
     31        }
    732    }
    833}
Note: See TracChangeset for help on using the changeset viewer.