Make WordPress Core

Ticket #38993: 38993.2.patch

File 38993.2.patch, 2.0 KB (added by davidakennedy, 9 years ago)

Check if the text color has been removed and use default colors in theme stylesheet.

  • src/wp-content/themes/twentyseventeen/assets/js/customize-preview.js

     
    88
    99        // Collect information from customize-controls.js about which panels are opening.
    1010        wp.customize.bind( 'preview-ready', function() {
    11                
     11
    1212                // Initially hide the theme option placeholders on load
    1313                $( '.panel-placeholder' ).hide();
    14                
     14
    1515                wp.customize.preview.bind( 'section-highlight', function( data ) {
    1616
    1717                        // Only on the front page.
     
    5858                                        clip: 'rect(1px, 1px, 1px, 1px)',
    5959                                        position: 'absolute'
    6060                                });
     61                                // Add class for different logo styles if title and description are hidden.
    6162                                $( 'body' ).addClass( 'title-tagline-hidden' );
    6263                        } else {
     64
     65                                // Check if the text color has been removed and use default colors in theme stylesheet.
     66                                if ( ! to.length ) {
     67                                        $( '#twentyseventeen-custom-header-styles' ).remove();
     68                                }
    6369                                $( '.site-title, .site-description' ).css({
    6470                                        clip: 'auto',
    6571                                        position: 'relative'
     
    6773                                $( '.site-branding, .site-branding a, .site-description, .site-description a' ).css({
    6874                                        color: to
    6975                                });
     76                                // Add class for different logo styles if title and description are visible.
    7077                                $( 'body' ).removeClass( 'title-tagline-hidden' );
    7178                        }
    7279                });
  • src/wp-content/themes/twentyseventeen/inc/custom-header.php

     
    6969
    7070        // If we get this far, we have custom styles. Let's do this.
    7171        ?>
    72         <style type="text/css">
     72        <style id="twentyseventeen-custom-header-styles" type="text/css">
    7373        <?php
    7474                // Has the text been hidden?
    7575                if ( 'blank' === $header_text_color ) :