Twenty Twelve: enable live preview for Header Text Color in Theme Customizer. Change also removes an `!important` declaration (yay) in Custom Header CSS rules.

Props SriniG, fixes #23600.

git-svn-id: http://core.svn.wordpress.org/trunk@23572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2013-03-01 17:45:59 +00:00
parent 80ec7836cb
commit 5907ac8e4b
3 changed files with 12 additions and 5 deletions

View File

@ -437,8 +437,9 @@ add_action( 'template_redirect', 'twentytwelve_content_width' );
* @return void
*/
function twentytwelve_customize_register( $wp_customize ) {
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
}
add_action( 'customize_register', 'twentytwelve_customize_register' );

View File

@ -77,9 +77,9 @@ function twentytwelve_header_style() {
// If the user has set a custom color for the text, use that.
else :
?>
.site-title a,
.site-description {
color: #<?php echo $text_color; ?> !important;
.site-header h1 a,
.site-header h2 {
color: #<?php echo $text_color; ?>;
}
<?php endif; ?>
</style>

View File

@ -17,6 +17,12 @@
$( '.site-description' ).text( to );
} );
} );
// Header text color
wp.customize( 'header_textcolor', function( value ) {
value.bind( function( to ) {
$( '.site-title a, .site-description' ).css( 'color', to );
} );
} );
// Hook into background color/image change and adjust body class value as needed.
wp.customize( 'background_color', function( value ) {