Make WordPress Core


Ignore:
Timestamp:
03/18/2014 03:20:38 PM (11 years ago)
Author:
ocean90
Message:

Widget Customizer: Restore highlighting of widgets in preview.

props westonruter.
see #27358.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r27543 r27584  
    757757        );
    758758
    759         /*
    760         wp_enqueue_style(
    761             'widget-customizer-preview',
    762             'widget-customizer-preview.css'
    763         );
    764         */
     759        add_action( 'wp_print_styles', array( __CLASS__, 'inject_preview_css' ), 1 );
    765760
    766761        // Why not wp_localize_script? Because we're not localizing, and it forces values into strings
     
    782777            sprintf( 'var WidgetCustomizerPreview_exports = %s;', json_encode( $exports ) )
    783778        );
     779    }
     780
     781    /**
     782     * Insert default style for highlighted widget at early point so theme
     783     * stylesheet can override.
     784     *
     785     * @action wp_print_styles
     786     */
     787    static function inject_preview_css() {
     788        ?>
     789        <style>
     790        .widget-customizer-highlighted-widget {
     791            border-radius: 2px;
     792            outline: none;
     793            box-shadow: 0 0 3px #ce0000;
     794        }
     795        </style>
     796        <?php
    784797    }
    785798
Note: See TracChangeset for help on using the changeset viewer.