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. Built from https://develop.svn.wordpress.org/trunk@39447 git-svn-id: http://core.svn.wordpress.org/trunk@39387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
179e9f20b6
commit
5edaa49d99
|
@ -8,10 +8,10 @@
|
|||
|
||||
// Collect information from customize-controls.js about which panels are opening.
|
||||
wp.customize.bind( 'preview-ready', function() {
|
||||
|
||||
|
||||
// Initially hide the theme option placeholders on load
|
||||
$( '.panel-placeholder' ).hide();
|
||||
|
||||
|
||||
wp.customize.preview.bind( 'section-highlight', function( data ) {
|
||||
|
||||
// Only on the front page.
|
||||
|
@ -58,8 +58,14 @@
|
|||
clip: 'rect(1px, 1px, 1px, 1px)',
|
||||
position: 'absolute'
|
||||
});
|
||||
// Add class for different logo styles if title and description are hidden.
|
||||
$( 'body' ).addClass( 'title-tagline-hidden' );
|
||||
} 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({
|
||||
clip: 'auto',
|
||||
position: 'relative'
|
||||
|
@ -67,6 +73,7 @@
|
|||
$( '.site-branding, .site-branding a, .site-description, .site-description a' ).css({
|
||||
color: to
|
||||
});
|
||||
// Add class for different logo styles if title and description are visible.
|
||||
$( '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.
|
||||
?>
|
||||
<style type="text/css">
|
||||
<style id="twentyseventeen-custom-header-styles" type="text/css">
|
||||
<?php
|
||||
// Has the text been hidden?
|
||||
if ( 'blank' === $header_text_color ) :
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.8-alpha-39444';
|
||||
$wp_version = '4.8-alpha-39447';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue