Make WordPress Core

Changeset 31971


Ignore:
Timestamp:
04/01/2015 09:41:36 PM (9 years ago)
Author:
lancewillett
Message:

Twenty Eleven: add postMessage support for header_textcolor to improve the user experience in the Customizer.

Fixes #24128, props kovshenin, jcastaneda, and lancewillett.

Location:
trunk/src/wp-content/themes/twentyeleven
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyeleven/functions.php

    r31267 r31971  
    252252        #site-title,
    253253        #site-description {
    254             position: absolute !important;
     254            position: absolute;
    255255            clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
    256256            clip: rect(1px, 1px, 1px, 1px);
     
    262262        #site-title a,
    263263        #site-description {
    264             color: #<?php echo $text_color; ?> !important;
     264            color: #<?php echo $text_color; ?>;
    265265        }
    266266    <?php endif; ?>
  • trunk/src/wp-content/themes/twentyeleven/inc/theme-customizer.js

    r23429 r31971  
    1010        } );
    1111    } );
     12
     13    // Header text color
     14    wp.customize( 'header_textcolor', function( value ) {
     15        value.bind( function( to ) {
     16            if ( 'blank' === to ) {
     17                $( '#site-title, #site-title a, #site-description' ).css( {
     18                    'clip': 'rect(1px, 1px, 1px, 1px)',
     19                    'position': 'absolute'
     20                } );
     21            } else {
     22                $( '#site-title, #site-title a, #site-description' ).css( {
     23                    'clip': 'auto',
     24                    'color': to,
     25                    'position': 'relative'
     26                } );
     27            }
     28        } );
     29    } );
    1230} )( jQuery );
  • trunk/src/wp-content/themes/twentyeleven/inc/theme-options.php

    r31265 r31971  
    509509    $wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
    510510    $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
     511    $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
    511512
    512513    $options  = twentyeleven_get_theme_options();
     
    582583 */
    583584function twentyeleven_customize_preview_js() {
    584     wp_enqueue_script( 'twentyeleven-customizer', get_template_directory_uri() . '/inc/theme-customizer.js', array( 'customize-preview' ), '20120523', true );
     585    wp_enqueue_script( 'twentyeleven-customizer', get_template_directory_uri() . '/inc/theme-customizer.js', array( 'customize-preview' ), '20150401', true );
    585586}
    586587add_action( 'customize_preview_init', 'twentyeleven_customize_preview_js' );
  • trunk/src/wp-content/themes/twentyeleven/style.css

    r31840 r31971  
    24532453        font-size: 12px;
    24542454    }
     2455    #branding .only-search + #access div {
     2456        padding-right: 0;
     2457    }
    24552458    article.intro .entry-content {
    24562459        font-size: 12px;
Note: See TracChangeset for help on using the changeset viewer.