Making WordPress.org

Changeset 3672


Ignore:
Timestamp:
07/12/2016 05:50:17 PM (8 years ago)
Author:
obenland
Message:

Breathe: Abstract and re-use existing styles.

See #1836.

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

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/functions.php

    r3659 r3672  
    77
    88    // Cacheing hack
    9     wp_enqueue_style( 'wporg-breathe', get_stylesheet_uri(), array( 'p2-breathe' ), '20160709' );
     9    wp_enqueue_style( 'wporg-breathe', get_stylesheet_uri(), array( 'p2-breathe' ), '20160712' );
    1010}
    1111add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\styles', 11 );
     
    1818            el.addEventListener( 'click', function( e ) {
    1919                document.cookie = el.dataset.cookie + '=' + el.dataset.hash + '; expires=Fri, 31 Dec 9999 23:59:59 GMT';
    20                 var wrapper = document.getElementsByClassName( 'make-welcome-wrapper' ).item( 0 );
    21                 if ( wrapper ) {
    22                     jQuery( wrapper ).slideUp();
    23                 }
     20                jQuery( '.make-welcome' ).slideUp();
    2421            } );
    2522        }
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/header.php

    r3671 r3672  
    11<?php
     2$welcome = get_page_by_path( 'welcome' );
     3$cookie  = 'welcome-' . get_current_blog_id();
     4$hash    = isset( $_COOKIE[ $cookie ] ) ? $_COOKIE[ $cookie ] : '';
     5$content_hash = $welcome ? md5( $welcome->post_content ) : '';
    26
    37$GLOBALS['pagetitle'] = get_bloginfo( 'name', 'display' );
     
    2125
    2226<?php
    23 $welcome = get_page_by_path( 'welcome' );
    2427
    25 $cookie = 'welcome-' . get_current_blog_id();
    26 
    27 $hash = isset( $_COOKIE[ $cookie ] ) ? $_COOKIE[ $cookie ] : '';
    28 
    29 $content_hash = $welcome ? md5( $welcome->post_content ) : '';
    30 
    31 if ( $welcome && ( empty( $hash ) || $content_hash !== $hash ) ) {
     28if ( $welcome && ( empty( $hash ) || $content_hash !== $hash ) ) :
    3229    $columns = preg_split( '|<hr\s*/?>|', $welcome->post_content );
    3330    if ( count( $columns ) === 2 ) {
    34         $welcome->post_content = "<div class='first-column'>\n\n{$columns[0]}</div><div class='second-column'>\n\n{$columns[1]}</div>";
     31        $welcome->post_content = "<div class='content-area'>\n\n{$columns[0]}</div><div class='widget-area'>\n\n{$columns[1]}</div>";
    3532    }
    3633    setup_postdata( $welcome );
    3734?>
    38 <div class="make-welcome-wrapper">
    39     <span id="make-welcome-hide" class="dashicons dashicons-no" data-hash="<?php echo $content_hash; ?>" data-cookie="<?php echo $cookie; ?>" title="<?php _e( 'Hide this message', 'p2-breathe' ); ?>"></span>
    40     <?php
    41     edit_post_link( __( 'Edit', 'o2' ), '<p class="make-welcome-edit">', '</p>', $welcome->ID );
    42     ?>
    43     <div class="make-welcome">
    44         <?php
    45         the_content();
    46         ?>
     35<div class="make-welcome">
     36    <div class="entry-meta">
     37        <?php edit_post_link( __( 'Edit', 'o2' ) ); ?>
     38        <button type="button" id="make-welcome-hide" class="toggle dashicons dashicons-no" data-hash="<?php echo $content_hash; ?>" data-cookie="<?php echo $cookie; ?>" title="<?php esc_attr_e( 'Hide this message', 'p2-breathe' ); ?>"></button>
     39    </div>
     40    <div class="entry-content clear">
     41        <?php the_content(); ?>
    4742    </div>
    4843</div>
    4944<?php
    5045    wp_reset_postdata();
    51 }
     46endif;
    5247?>
    5348
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/style.css

    r3671 r3672  
    172172        overflow-x: hidden;
    173173    }
    174    
     174
    175175    body.responsive-show #page {
    176176        overflow-x: visible;
     
    328328}
    329329
    330 .make-welcome-wrapper {
    331     width: 100%;
     330.make-welcome {
    332331    background: #eee;
    333332    /* jQuery slideUp overrides the margin, causing the animation to be a bit funky. !important stops that. */
    334333    margin: -4em 0 4em 0 !important;
     334    padding: 2em 0;
    335335    position: relative;
    336     padding: 2em 0;
    337 }
    338 
    339 #make-welcome-hide {
    340     position: absolute;
    341     right: 0;
    342     top: 0;
    343     margin: 15px;
    344     cursor: pointer;
    345 }
    346 
    347 .make-welcome-edit {
    348     position: absolute;
    349     right: 50px;
    350     top: 0;
    351     padding-right: 15px;
    352     border-right: 1px solid #ccc;
    353     font-size: 1.3em;
    354     line-height: 1.5;
    355 }
    356 
    357 .make-welcome {
     336    width: 100%;
     337}
     338
     339.make-welcome .entry-content {
    358340    font-size: 14px;
    359341    color: #333;
     
    362344    max-width: 940px;
    363345    margin: 0px auto;
    364     padding: 0 0 14px;
    365 }
    366 
    367 .make-welcome h4 {
     346    padding: 0;
     347}
     348
     349.make-welcome .entry-content h4 {
    368350    margin: 14px 0;
    369351}
    370352
    371 .make-welcome p {
     353.make-welcome .entry-content p {
    372354    display: inline;
    373355}
    374356
    375 .make-welcome h4,
    376 .make-welcome .welcome p:first-child {
     357.make-welcome .entry-content h4,
     358.make-welcome .entry-content .welcome p:first-child {
    377359    font-weight: normal;
    378360    font-size: 18px;
     
    380362}
    381363
    382 .make-welcome .column {
     364.make-welcome .entry-content .column {
    383365    vertical-align: top;
    384366    display: inline-block;
     
    386368}
    387369
    388 .make-welcome .first-column {
    389     width: 71%;
    390     display: inline-block;
    391 }
    392 
    393 .make-welcome .second-column {
    394     width: 25%;
    395     float: right;
    396 }
    397 
    398 .make-welcome .welcome {
     370.make-welcome .entry-content .welcome {
    399371    padding-top: 1%;
    400372}
    401373
    402 .make-welcome .o2-appended-tags,
    403 .make-welcome .o2-post-footer-actions {
     374.make-welcome .entry-content .o2-appended-tags,
     375.make-welcome .entry-content .o2-post-footer-actions {
    404376    display: none;
    405377}
    406378
     379.make-welcome .entry-meta {
     380    margin: 15px;
     381    position: absolute;
     382    right: 0;
     383    top: 0;
     384}
     385
     386.make-welcome .entry-meta .post-edit-link {
     387    margin-right: 15px;
     388}
     389
     390.make-welcome .entry-meta [type="button"] {
     391    background: transparent;
     392    border: 0;
     393    box-shadow: none;
     394    -webkit-appearance: none;
     395    padding: 0;
     396    text-shadow: none;
     397}
     398
     399.make-welcome .entry-meta [type="button"]:focus {
     400    outline: thin dotted;
     401}
     402
    407403@media screen and (min-width: 960px) {
    408     .make-welcome {
    409         padding-bottom: 0;
    410     }
    411 
    412     .make-welcome p {
     404    .make-welcome .entry-content p {
    413405        display: block;
    414406    }
    415407
    416     .make-welcome .column {
     408    .make-welcome .entry-content .column {
    417409        width: 30%;
    418410        padding: 1.5%;
    419411    }
    420412
    421     .make-welcome .welcome p:first-child {
     413    .make-welcome .entry-content .welcome p:first-child {
    422414        font-size: 22px;
    423415        margin: 12px 0 23px;
    424416    }
    425417
    426     .make-welcome h4, .make-welcome p {
     418    .make-welcome .entry-content h4,
     419    .make-welcome .entry-content p {
    427420        margin-bottom: 14px;
    428421    }
     
    430423
    431424@media screen and (max-width: 1000px) {
    432     .make-welcome .first-column,
    433     .make-welcome .second-column {
     425    .make-welcome .entry-content .content-area,
     426    .make-welcome .entry-content .widget-area {
     427        clear: both;
     428        float: none;
     429        padding: 0 20px;
    434430        width: auto;
    435         float: none;
    436         clear: both;
    437         padding: 0 20px;
    438     }
    439 }
     431    }
     432}
Note: See TracChangeset for help on using the changeset viewer.