Twenty Seventeen: Ensure header text color updates in Customizer preview when cleared
Checks if the text color has been cleared and removes the `style` block if it has been. Uses color styles in theme stylesheet. Props sstoqnov, davidakennedy. Fixes #38993. git-svn-id: https://develop.svn.wordpress.org/trunk@39447 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8c26572c8a
commit
289ced158b
@ -8,10 +8,10 @@
|
|||||||
|
|
||||||
// Collect information from customize-controls.js about which panels are opening.
|
// Collect information from customize-controls.js about which panels are opening.
|
||||||
wp.customize.bind( 'preview-ready', function() {
|
wp.customize.bind( 'preview-ready', function() {
|
||||||
|
|
||||||
// Initially hide the theme option placeholders on load
|
// Initially hide the theme option placeholders on load
|
||||||
$( '.panel-placeholder' ).hide();
|
$( '.panel-placeholder' ).hide();
|
||||||
|
|
||||||
wp.customize.preview.bind( 'section-highlight', function( data ) {
|
wp.customize.preview.bind( 'section-highlight', function( data ) {
|
||||||
|
|
||||||
// Only on the front page.
|
// Only on the front page.
|
||||||
@ -58,8 +58,14 @@
|
|||||||
clip: 'rect(1px, 1px, 1px, 1px)',
|
clip: 'rect(1px, 1px, 1px, 1px)',
|
||||||
position: 'absolute'
|
position: 'absolute'
|
||||||
});
|
});
|
||||||
|
// Add class for different logo styles if title and description are hidden.
|
||||||
$( 'body' ).addClass( 'title-tagline-hidden' );
|
$( 'body' ).addClass( 'title-tagline-hidden' );
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
// Check if the text color has been removed and use default colors in theme stylesheet.
|
||||||
|
if ( ! to.length ) {
|
||||||
|
$( '#twentyseventeen-custom-header-styles' ).remove();
|
||||||
|
}
|
||||||
$( '.site-title, .site-description' ).css({
|
$( '.site-title, .site-description' ).css({
|
||||||
clip: 'auto',
|
clip: 'auto',
|
||||||
position: 'relative'
|
position: 'relative'
|
||||||
@ -67,6 +73,7 @@
|
|||||||
$( '.site-branding, .site-branding a, .site-description, .site-description a' ).css({
|
$( '.site-branding, .site-branding a, .site-description, .site-description a' ).css({
|
||||||
color: to
|
color: to
|
||||||
});
|
});
|
||||||
|
// Add class for different logo styles if title and description are visible.
|
||||||
$( 'body' ).removeClass( 'title-tagline-hidden' );
|
$( 'body' ).removeClass( 'title-tagline-hidden' );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -69,7 +69,7 @@ function twentyseventeen_header_style() {
|
|||||||
|
|
||||||
// If we get this far, we have custom styles. Let's do this.
|
// If we get this far, we have custom styles. Let's do this.
|
||||||
?>
|
?>
|
||||||
<style type="text/css">
|
<style id="twentyseventeen-custom-header-styles" type="text/css">
|
||||||
<?php
|
<?php
|
||||||
// Has the text been hidden?
|
// Has the text been hidden?
|
||||||
if ( 'blank' === $header_text_color ) :
|
if ( 'blank' === $header_text_color ) :
|
||||||
|
Loading…
Reference in New Issue
Block a user