3 * Twenty Sixteen Customizer functionality
6 * @subpackage Twenty_Sixteen
7 * @since Twenty Sixteen 1.0
11 * Sets up the WordPress core custom header and custom background features.
13 * @since Twenty Sixteen 1.0
15 * @see twentysixteen_header_style()
17 function twentysixteen_custom_header_and_background() {
18 $color_scheme = twentysixteen_get_color_scheme();
19 $default_background_color = trim( $color_scheme[0], '#' );
20 $default_text_color = trim( $color_scheme[3], '#' );
23 * Filter the arguments used when adding 'custom-background' support in Twenty Sixteen.
25 * @since Twenty Sixteen 1.0
27 * @param array $args {
28 * An array of custom-background support arguments.
30 * @type string $default-color Default color of the background.
33 add_theme_support( 'custom-background', apply_filters( 'twentysixteen_custom_background_args', array(
34 'default-color' => $default_background_color,
38 * Filter the arguments used when adding 'custom-header' support in Twenty Sixteen.
40 * @since Twenty Sixteen 1.0
42 * @param array $args {
43 * An array of custom-header support arguments.
45 * @type string $default-text-color Default color of the header text.
46 * @type int $width Width in pixels of the custom header image. Default 1200.
47 * @type int $height Height in pixels of the custom header image. Default 280.
48 * @type bool $flex-height Whether to allow flexible-height header images. Default true.
49 * @type callable $wp-head-callback Callback function used to style the header image and text
50 * displayed on the blog.
53 add_theme_support( 'custom-header', apply_filters( 'twentysixteen_custom_header_args', array(
54 'default-text-color' => $default_text_color,
57 'flex-height' => true,
58 'wp-head-callback' => 'twentysixteen_header_style',
61 add_action( 'after_setup_theme', 'twentysixteen_custom_header_and_background' );
63 if ( ! function_exists( 'twentysixteen_header_style' ) ) :
65 * Styles the header text displayed on the site.
67 * Create your own twentysixteen_header_style() function to override in a child theme.
69 * @since Twenty Sixteen 1.0
71 * @see twentysixteen_custom_header_and_background().
73 function twentysixteen_header_style() {
74 // If the header text option is untouched, let's bail.
75 if ( display_header_text() ) {
79 // If the header text has been hidden.
81 <style type="text/css" id="twentysixteen-header-css">
86 .site-branding .site-title,
88 clip: rect(1px, 1px, 1px, 1px);
94 endif; // twentysixteen_header_style
97 * Adds postMessage support for site title and description for the Customizer.
99 * @since Twenty Sixteen 1.0
101 * @param WP_Customize_Manager $wp_customize The Customizer object.
103 function twentysixteen_customize_register( $wp_customize ) {
104 $color_scheme = twentysixteen_get_color_scheme();
106 $wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
107 $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
109 if ( isset( $wp_customize->selective_refresh ) ) {
110 $wp_customize->selective_refresh->add_partial( 'blogname', array(
111 'selector' => '.site-title a',
112 'container_inclusive' => false,
113 'render_callback' => 'twentysixteen_customize_partial_blogname',
115 $wp_customize->selective_refresh->add_partial( 'blogdescription', array(
116 'selector' => '.site-description',
117 'container_inclusive' => false,
118 'render_callback' => 'twentysixteen_customize_partial_blogdescription',
122 // Add color scheme setting and control.
123 $wp_customize->add_setting( 'color_scheme', array(
124 'default' => 'default',
125 'sanitize_callback' => 'twentysixteen_sanitize_color_scheme',
126 'transport' => 'postMessage',
129 $wp_customize->add_control( 'color_scheme', array(
130 'label' => __( 'Base Color Scheme', 'twentysixteen' ),
131 'section' => 'colors',
133 'choices' => twentysixteen_get_color_scheme_choices(),
137 // Add page background color setting and control.
138 $wp_customize->add_setting( 'page_background_color', array(
139 'default' => $color_scheme[1],
140 'sanitize_callback' => 'sanitize_hex_color',
141 'transport' => 'postMessage',
144 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'page_background_color', array(
145 'label' => __( 'Page Background Color', 'twentysixteen' ),
146 'section' => 'colors',
149 // Remove the core header textcolor control, as it shares the main text color.
150 $wp_customize->remove_control( 'header_textcolor' );
152 // Add link color setting and control.
153 $wp_customize->add_setting( 'link_color', array(
154 'default' => $color_scheme[2],
155 'sanitize_callback' => 'sanitize_hex_color',
156 'transport' => 'postMessage',
159 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_color', array(
160 'label' => __( 'Link Color', 'twentysixteen' ),
161 'section' => 'colors',
164 // Add main text color setting and control.
165 $wp_customize->add_setting( 'main_text_color', array(
166 'default' => $color_scheme[3],
167 'sanitize_callback' => 'sanitize_hex_color',
168 'transport' => 'postMessage',
171 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'main_text_color', array(
172 'label' => __( 'Main Text Color', 'twentysixteen' ),
173 'section' => 'colors',
176 // Add secondary text color setting and control.
177 $wp_customize->add_setting( 'secondary_text_color', array(
178 'default' => $color_scheme[4],
179 'sanitize_callback' => 'sanitize_hex_color',
180 'transport' => 'postMessage',
183 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'secondary_text_color', array(
184 'label' => __( 'Secondary Text Color', 'twentysixteen' ),
185 'section' => 'colors',
188 add_action( 'customize_register', 'twentysixteen_customize_register', 11 );
191 * Render the site title for the selective refresh partial.
193 * @since Twenty Sixteen 1.2
194 * @see twentysixteen_customize_register()
198 function twentysixteen_customize_partial_blogname() {
203 * Render the site tagline for the selective refresh partial.
205 * @since Twenty Sixteen 1.2
206 * @see twentysixteen_customize_register()
210 function twentysixteen_customize_partial_blogdescription() {
211 bloginfo( 'description' );
215 * Registers color schemes for Twenty Sixteen.
217 * Can be filtered with {@see 'twentysixteen_color_schemes'}.
219 * The order of colors in a colors array:
220 * 1. Main Background Color.
221 * 2. Page Background Color.
223 * 4. Main Text Color.
224 * 5. Secondary Text Color.
226 * @since Twenty Sixteen 1.0
228 * @return array An associative array of color scheme options.
230 function twentysixteen_get_color_schemes() {
232 * Filter the color schemes registered for use with Twenty Sixteen.
234 * The default schemes include 'default', 'dark', 'gray', 'red', and 'yellow'.
236 * @since Twenty Sixteen 1.0
238 * @param array $schemes {
239 * Associative array of color schemes data.
241 * @type array $slug {
242 * Associative array of information for setting up the color scheme.
244 * @type string $label Color scheme label.
245 * @type array $colors HEX codes for default colors prepended with a hash symbol ('#').
246 * Colors are defined in the following order: Main background, page
247 * background, link, main text, secondary text.
251 return apply_filters( 'twentysixteen_color_schemes', array(
253 'label' => __( 'Default', 'twentysixteen' ),
263 'label' => __( 'Dark', 'twentysixteen' ),
273 'label' => __( 'Gray', 'twentysixteen' ),
283 'label' => __( 'Red', 'twentysixteen' ),
293 'label' => __( 'Yellow', 'twentysixteen' ),
305 if ( ! function_exists( 'twentysixteen_get_color_scheme' ) ) :
307 * Retrieves the current Twenty Sixteen color scheme.
309 * Create your own twentysixteen_get_color_scheme() function to override in a child theme.
311 * @since Twenty Sixteen 1.0
313 * @return array An associative array of either the current or default color scheme HEX values.
315 function twentysixteen_get_color_scheme() {
316 $color_scheme_option = get_theme_mod( 'color_scheme', 'default' );
317 $color_schemes = twentysixteen_get_color_schemes();
319 if ( array_key_exists( $color_scheme_option, $color_schemes ) ) {
320 return $color_schemes[ $color_scheme_option ]['colors'];
323 return $color_schemes['default']['colors'];
325 endif; // twentysixteen_get_color_scheme
327 if ( ! function_exists( 'twentysixteen_get_color_scheme_choices' ) ) :
329 * Retrieves an array of color scheme choices registered for Twenty Sixteen.
331 * Create your own twentysixteen_get_color_scheme_choices() function to override
334 * @since Twenty Sixteen 1.0
336 * @return array Array of color schemes.
338 function twentysixteen_get_color_scheme_choices() {
339 $color_schemes = twentysixteen_get_color_schemes();
340 $color_scheme_control_options = array();
342 foreach ( $color_schemes as $color_scheme => $value ) {
343 $color_scheme_control_options[ $color_scheme ] = $value['label'];
346 return $color_scheme_control_options;
348 endif; // twentysixteen_get_color_scheme_choices
351 if ( ! function_exists( 'twentysixteen_sanitize_color_scheme' ) ) :
353 * Handles sanitization for Twenty Sixteen color schemes.
355 * Create your own twentysixteen_sanitize_color_scheme() function to override
358 * @since Twenty Sixteen 1.0
360 * @param string $value Color scheme name value.
361 * @return string Color scheme name.
363 function twentysixteen_sanitize_color_scheme( $value ) {
364 $color_schemes = twentysixteen_get_color_scheme_choices();
366 if ( ! array_key_exists( $value, $color_schemes ) ) {
372 endif; // twentysixteen_sanitize_color_scheme
375 * Enqueues front-end CSS for color scheme.
377 * @since Twenty Sixteen 1.0
379 * @see wp_add_inline_style()
381 function twentysixteen_color_scheme_css() {
382 $color_scheme_option = get_theme_mod( 'color_scheme', 'default' );
384 // Don't do anything if the default color scheme is selected.
385 if ( 'default' === $color_scheme_option ) {
389 $color_scheme = twentysixteen_get_color_scheme();
391 // Convert main text hex color to rgba.
392 $color_textcolor_rgb = twentysixteen_hex2rgb( $color_scheme[3] );
394 // If the rgba values are empty return early.
395 if ( empty( $color_textcolor_rgb ) ) {
399 // If we get this far, we have a custom color scheme.
401 'background_color' => $color_scheme[0],
402 'page_background_color' => $color_scheme[1],
403 'link_color' => $color_scheme[2],
404 'main_text_color' => $color_scheme[3],
405 'secondary_text_color' => $color_scheme[4],
406 'border_color' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.2)', $color_textcolor_rgb ),
410 $color_scheme_css = twentysixteen_get_color_scheme_css( $colors );
412 wp_add_inline_style( 'twentysixteen-style', $color_scheme_css );
414 add_action( 'wp_enqueue_scripts', 'twentysixteen_color_scheme_css' );
417 * Binds the JS listener to make Customizer color_scheme control.
419 * Passes color scheme data as colorScheme global.
421 * @since Twenty Sixteen 1.0
423 function twentysixteen_customize_control_js() {
424 wp_enqueue_script( 'color-scheme-control', get_template_directory_uri() . '/js/color-scheme-control.js', array( 'customize-controls', 'iris', 'underscore', 'wp-util' ), '20160816', true );
425 wp_localize_script( 'color-scheme-control', 'colorScheme', twentysixteen_get_color_schemes() );
427 add_action( 'customize_controls_enqueue_scripts', 'twentysixteen_customize_control_js' );
430 * Binds JS handlers to make the Customizer preview reload changes asynchronously.
432 * @since Twenty Sixteen 1.0
434 function twentysixteen_customize_preview_js() {
435 wp_enqueue_script( 'twentysixteen-customize-preview', get_template_directory_uri() . '/js/customize-preview.js', array( 'customize-preview' ), '20160816', true );
437 add_action( 'customize_preview_init', 'twentysixteen_customize_preview_js' );
440 * Returns CSS for the color schemes.
442 * @since Twenty Sixteen 1.0
444 * @param array $colors Color scheme colors.
445 * @return string Color scheme CSS.
447 function twentysixteen_get_color_scheme_css( $colors ) {
448 $colors = wp_parse_args( $colors, array(
449 'background_color' => '',
450 'page_background_color' => '',
452 'main_text_color' => '',
453 'secondary_text_color' => '',
454 'border_color' => '',
460 /* Background Color */
462 background-color: {$colors['background_color']};
465 /* Page Background Color */
467 background-color: {$colors['page_background_color']};
473 button[disabled]:hover,
474 button[disabled]:focus,
475 input[type="button"],
476 input[type="button"][disabled]:hover,
477 input[type="button"][disabled]:focus,
479 input[type="reset"][disabled]:hover,
480 input[type="reset"][disabled]:focus,
481 input[type="submit"],
482 input[type="submit"][disabled]:hover,
483 input[type="submit"][disabled]:focus,
484 .menu-toggle.toggled-on,
485 .menu-toggle.toggled-on:hover,
486 .menu-toggle.toggled-on:focus,
489 .pagination .prev:hover,
490 .pagination .prev:focus,
491 .pagination .next:hover,
492 .pagination .next:focus,
493 .pagination .nav-links:before,
494 .pagination .nav-links:after,
495 .widget_calendar tbody a,
496 .widget_calendar tbody a:hover,
497 .widget_calendar tbody a:focus,
500 .page-links a:focus {
501 color: {$colors['page_background_color']};
508 .main-navigation a:hover,
509 .main-navigation a:focus,
510 .dropdown-toggle:hover,
511 .dropdown-toggle:focus,
512 .social-navigation a:hover:before,
513 .social-navigation a:focus:before,
514 .post-navigation a:hover .post-title,
515 .post-navigation a:focus .post-title,
518 .site-branding .site-title a:hover,
519 .site-branding .site-title a:focus,
520 .entry-title a:hover,
521 .entry-title a:focus,
522 .entry-footer a:hover,
523 .entry-footer a:focus,
524 .comment-metadata a:hover,
525 .comment-metadata a:focus,
526 .pingback .comment-edit-link:hover,
527 .pingback .comment-edit-link:focus,
529 .comment-reply-link:hover,
530 .comment-reply-link:focus,
534 color: {$colors['link_color']};
541 input[type="button"]:hover,
542 input[type="button"]:focus,
543 input[type="reset"]:hover,
544 input[type="reset"]:focus,
545 input[type="submit"]:hover,
546 input[type="submit"]:focus,
547 .pagination .prev:hover,
548 .pagination .prev:focus,
549 .pagination .next:hover,
550 .pagination .next:focus,
551 .widget_calendar tbody a,
553 .page-links a:focus {
554 background-color: {$colors['link_color']};
557 input[type="date"]:focus,
558 input[type="time"]:focus,
559 input[type="datetime-local"]:focus,
560 input[type="week"]:focus,
561 input[type="month"]:focus,
562 input[type="text"]:focus,
563 input[type="email"]:focus,
564 input[type="url"]:focus,
565 input[type="password"]:focus,
566 input[type="search"]:focus,
567 input[type="tel"]:focus,
568 input[type="number"]:focus,
574 border-color: {$colors['link_color']};
577 /* Main Text Color */
584 .social-navigation a,
589 .site-branding .site-title a,
591 .page-links > .page-links-title,
593 .comment-reply-title small a:hover,
594 .comment-reply-title small a:focus {
595 color: {$colors['main_text_color']};
599 .menu-toggle.toggled-on,
600 .menu-toggle.toggled-on:hover,
601 .menu-toggle.toggled-on:focus,
603 .post-navigation div + div,
609 .comment-reply-title {
610 border-color: {$colors['main_text_color']};
614 button[disabled]:hover,
615 button[disabled]:focus,
616 input[type="button"],
617 input[type="button"][disabled]:hover,
618 input[type="button"][disabled]:focus,
620 input[type="reset"][disabled]:hover,
621 input[type="reset"][disabled]:focus,
622 input[type="submit"],
623 input[type="submit"][disabled]:hover,
624 input[type="submit"][disabled]:focus,
625 .menu-toggle.toggled-on,
626 .menu-toggle.toggled-on:hover,
627 .menu-toggle.toggled-on:focus,
633 background-color: {$colors['main_text_color']};
636 /* Secondary Text Color */
639 * IE8 and earlier will drop any block with CSS3 selectors.
640 * Do not combine these styles with the next block.
642 body:not(.search-results) .entry-summary {
643 color: {$colors['secondary_text_color']};
647 .post-password-form label,
651 .post-navigation .meta-nav,
654 .widget_recent_entries .post-date,
655 .widget_rss .rss-date,
662 .taxonomy-description,
665 .pingback .edit-link,
667 .pingback .comment-edit-link,
670 .comment-awaiting-moderation,
675 .wp-caption .wp-caption-text,
678 .widecolumn .mu_register label {
679 color: {$colors['secondary_text_color']};
682 .widget_calendar tbody a:hover,
683 .widget_calendar tbody a:focus {
684 background-color: {$colors['secondary_text_color']};
697 input[type="datetime-local"],
703 input[type="password"],
704 input[type="search"],
706 input[type="number"],
709 .main-navigation .primary-menu,
711 .dropdown-toggle:after,
712 .social-navigation a,
720 .comment-list article,
721 .comment-list .pingback,
722 .comment-list .trackback,
725 .widecolumn .mu_register .mu_alert {
726 border-color: {$colors['main_text_color']}; /* Fallback for IE7 and IE8 */
727 border-color: {$colors['border_color']};
732 background-color: {$colors['main_text_color']}; /* Fallback for IE7 and IE8 */
733 background-color: {$colors['border_color']};
736 @media screen and (min-width: 56.875em) {
737 .main-navigation li:hover > a,
738 .main-navigation li.focus > a {
739 color: {$colors['link_color']};
742 .main-navigation ul ul,
743 .main-navigation ul ul li {
744 border-color: {$colors['border_color']};
747 .main-navigation ul ul:before {
748 border-top-color: {$colors['border_color']};
749 border-bottom-color: {$colors['border_color']};
752 .main-navigation ul ul li {
753 background-color: {$colors['page_background_color']};
756 .main-navigation ul ul:after {
757 border-top-color: {$colors['page_background_color']};
758 border-bottom-color: {$colors['page_background_color']};
767 * Outputs an Underscore template for generating CSS for the color scheme.
769 * The template generates the css dynamically for instant display in the
770 * Customizer preview.
772 * @since Twenty Sixteen 1.0
774 function twentysixteen_color_scheme_css_template() {
776 'background_color' => '{{ data.background_color }}',
777 'page_background_color' => '{{ data.page_background_color }}',
778 'link_color' => '{{ data.link_color }}',
779 'main_text_color' => '{{ data.main_text_color }}',
780 'secondary_text_color' => '{{ data.secondary_text_color }}',
781 'border_color' => '{{ data.border_color }}',
784 <script type="text/html" id="tmpl-twentysixteen-color-scheme">
785 <?php echo twentysixteen_get_color_scheme_css( $colors ); ?>
789 add_action( 'customize_controls_print_footer_scripts', 'twentysixteen_color_scheme_css_template' );
792 * Enqueues front-end CSS for the page background color.
794 * @since Twenty Sixteen 1.0
796 * @see wp_add_inline_style()
798 function twentysixteen_page_background_color_css() {
799 $color_scheme = twentysixteen_get_color_scheme();
800 $default_color = $color_scheme[1];
801 $page_background_color = get_theme_mod( 'page_background_color', $default_color );
803 // Don't do anything if the current color is the default.
804 if ( $page_background_color === $default_color ) {
809 /* Custom Page Background Color */
811 background-color: %1$s;
817 button[disabled]:hover,
818 button[disabled]:focus,
819 input[type="button"],
820 input[type="button"][disabled]:hover,
821 input[type="button"][disabled]:focus,
823 input[type="reset"][disabled]:hover,
824 input[type="reset"][disabled]:focus,
825 input[type="submit"],
826 input[type="submit"][disabled]:hover,
827 input[type="submit"][disabled]:focus,
828 .menu-toggle.toggled-on,
829 .menu-toggle.toggled-on:hover,
830 .menu-toggle.toggled-on:focus,
833 .pagination .prev:hover,
834 .pagination .prev:focus,
835 .pagination .next:hover,
836 .pagination .next:focus,
837 .pagination .nav-links:before,
838 .pagination .nav-links:after,
839 .widget_calendar tbody a,
840 .widget_calendar tbody a:hover,
841 .widget_calendar tbody a:focus,
844 .page-links a:focus {
848 @media screen and (min-width: 56.875em) {
849 .main-navigation ul ul li {
850 background-color: %1$s;
853 .main-navigation ul ul:after {
854 border-top-color: %1$s;
855 border-bottom-color: %1$s;
860 wp_add_inline_style( 'twentysixteen-style', sprintf( $css, $page_background_color ) );
862 add_action( 'wp_enqueue_scripts', 'twentysixteen_page_background_color_css', 11 );
865 * Enqueues front-end CSS for the link color.
867 * @since Twenty Sixteen 1.0
869 * @see wp_add_inline_style()
871 function twentysixteen_link_color_css() {
872 $color_scheme = twentysixteen_get_color_scheme();
873 $default_color = $color_scheme[2];
874 $link_color = get_theme_mod( 'link_color', $default_color );
876 // Don't do anything if the current color is the default.
877 if ( $link_color === $default_color ) {
882 /* Custom Link Color */
886 .main-navigation a:hover,
887 .main-navigation a:focus,
888 .dropdown-toggle:hover,
889 .dropdown-toggle:focus,
890 .social-navigation a:hover:before,
891 .social-navigation a:focus:before,
892 .post-navigation a:hover .post-title,
893 .post-navigation a:focus .post-title,
896 .site-branding .site-title a:hover,
897 .site-branding .site-title a:focus,
898 .entry-title a:hover,
899 .entry-title a:focus,
900 .entry-footer a:hover,
901 .entry-footer a:focus,
902 .comment-metadata a:hover,
903 .comment-metadata a:focus,
904 .pingback .comment-edit-link:hover,
905 .pingback .comment-edit-link:focus,
907 .comment-reply-link:hover,
908 .comment-reply-link:focus,
919 input[type="button"]:hover,
920 input[type="button"]:focus,
921 input[type="reset"]:hover,
922 input[type="reset"]:focus,
923 input[type="submit"]:hover,
924 input[type="submit"]:focus,
925 .pagination .prev:hover,
926 .pagination .prev:focus,
927 .pagination .next:hover,
928 .pagination .next:focus,
929 .widget_calendar tbody a,
931 .page-links a:focus {
932 background-color: %1$s;
935 input[type="date"]:focus,
936 input[type="time"]:focus,
937 input[type="datetime-local"]:focus,
938 input[type="week"]:focus,
939 input[type="month"]:focus,
940 input[type="text"]:focus,
941 input[type="email"]:focus,
942 input[type="url"]:focus,
943 input[type="password"]:focus,
944 input[type="search"]:focus,
945 input[type="tel"]:focus,
946 input[type="number"]:focus,
955 @media screen and (min-width: 56.875em) {
956 .main-navigation li:hover > a,
957 .main-navigation li.focus > a {
963 wp_add_inline_style( 'twentysixteen-style', sprintf( $css, $link_color ) );
965 add_action( 'wp_enqueue_scripts', 'twentysixteen_link_color_css', 11 );
968 * Enqueues front-end CSS for the main text color.
970 * @since Twenty Sixteen 1.0
972 * @see wp_add_inline_style()
974 function twentysixteen_main_text_color_css() {
975 $color_scheme = twentysixteen_get_color_scheme();
976 $default_color = $color_scheme[3];
977 $main_text_color = get_theme_mod( 'main_text_color', $default_color );
979 // Don't do anything if the current color is the default.
980 if ( $main_text_color === $default_color ) {
984 // Convert main text hex color to rgba.
985 $main_text_color_rgb = twentysixteen_hex2rgb( $main_text_color );
987 // If the rgba values are empty return early.
988 if ( empty( $main_text_color_rgb ) ) {
992 // If we get this far, we have a custom color scheme.
993 $border_color = vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.2)', $main_text_color_rgb );
996 /* Custom Main Text Color */
1003 .social-navigation a,
1005 .pagination a:hover,
1006 .pagination a:focus,
1008 .site-branding .site-title a,
1010 .page-links > .page-links-title,
1012 .comment-reply-title small a:hover,
1013 .comment-reply-title small a:focus {
1018 .menu-toggle.toggled-on,
1019 .menu-toggle.toggled-on:hover,
1020 .menu-toggle.toggled-on:focus,
1022 .post-navigation div + div,
1028 .comment-reply-title {
1033 button[disabled]:hover,
1034 button[disabled]:focus,
1035 input[type="button"],
1036 input[type="button"][disabled]:hover,
1037 input[type="button"][disabled]:focus,
1038 input[type="reset"],
1039 input[type="reset"][disabled]:hover,
1040 input[type="reset"][disabled]:focus,
1041 input[type="submit"],
1042 input[type="submit"][disabled]:hover,
1043 input[type="submit"][disabled]:focus,
1044 .menu-toggle.toggled-on,
1045 .menu-toggle.toggled-on:hover,
1046 .menu-toggle.toggled-on:focus,
1052 background-color: %1$s;
1065 input[type="datetime-local"],
1067 input[type="month"],
1069 input[type="email"],
1071 input[type="password"],
1072 input[type="search"],
1074 input[type="number"],
1076 .main-navigation li,
1077 .main-navigation .primary-menu,
1079 .dropdown-toggle:after,
1080 .social-navigation a,
1082 .comment-navigation,
1088 .comment-list article,
1089 .comment-list .pingback,
1090 .comment-list .trackback,
1091 .comment-reply-link,
1093 .widecolumn .mu_register .mu_alert {
1094 border-color: %1$s; /* Fallback for IE7 and IE8 */
1100 background-color: %1$s; /* Fallback for IE7 and IE8 */
1101 background-color: %2$s;
1104 @media screen and (min-width: 56.875em) {
1105 .main-navigation ul ul,
1106 .main-navigation ul ul li {
1110 .main-navigation ul ul:before {
1111 border-top-color: %2$s;
1112 border-bottom-color: %2$s;
1117 wp_add_inline_style( 'twentysixteen-style', sprintf( $css, $main_text_color, $border_color ) );
1119 add_action( 'wp_enqueue_scripts', 'twentysixteen_main_text_color_css', 11 );
1122 * Enqueues front-end CSS for the secondary text color.
1124 * @since Twenty Sixteen 1.0
1126 * @see wp_add_inline_style()
1128 function twentysixteen_secondary_text_color_css() {
1129 $color_scheme = twentysixteen_get_color_scheme();
1130 $default_color = $color_scheme[4];
1131 $secondary_text_color = get_theme_mod( 'secondary_text_color', $default_color );
1133 // Don't do anything if the current color is the default.
1134 if ( $secondary_text_color === $default_color ) {
1139 /* Custom Secondary Text Color */
1142 * IE8 and earlier will drop any block with CSS3 selectors.
1143 * Do not combine these styles with the next block.
1145 body:not(.search-results) .entry-summary {
1150 .post-password-form label,
1154 .post-navigation .meta-nav,
1156 .comment-navigation,
1157 .widget_recent_entries .post-date,
1158 .widget_rss .rss-date,
1165 .taxonomy-description,
1168 .pingback .edit-link,
1169 .comment-metadata a,
1170 .pingback .comment-edit-link,
1171 .comment-form label,
1173 .comment-awaiting-moderation,
1178 .wp-caption .wp-caption-text,
1181 .widecolumn .mu_register label {
1185 .widget_calendar tbody a:hover,
1186 .widget_calendar tbody a:focus {
1187 background-color: %1$s;
1191 wp_add_inline_style( 'twentysixteen-style', sprintf( $css, $secondary_text_color ) );
1193 add_action( 'wp_enqueue_scripts', 'twentysixteen_secondary_text_color_css', 11 );