Make WordPress Core

Changeset 39448


Ignore:
Timestamp:
12/02/2016 11:02:15 PM (8 years ago)
Author:
helen
Message:

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 for the 4.7 branch.

Location:
branches/4.7
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

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

    r39421 r39448  
    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
     
    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',
     
    6874                    color: to
    6975                });
     76                // Add class for different logo styles if title and description are visible.
    7077                $( 'body' ).removeClass( 'title-tagline-hidden' );
    7178            }
  • branches/4.7/src/wp-content/themes/twentyseventeen/inc/custom-header.php

    r39416 r39448  
    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?
Note: See TracChangeset for help on using the changeset viewer.