WordPress.org

Make WordPress Core

Changeset 39447 for trunk


Ignore:
Timestamp:
12/02/2016 11:00:13 PM (4 years ago)
Author:
davidakennedy
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.

Location:
trunk/src/wp-content/themes/twentyseventeen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyseventeen/assets/js/customize-preview.js

    r39417 r39447  
    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            }
  • trunk/src/wp-content/themes/twentyseventeen/inc/custom-header.php

    r39415 r39447  
    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.