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' ), '20160412', 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' ), '20160412', 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="text"]:focus,
558 input[type="email"]:focus,
559 input[type="url"]:focus,
560 input[type="password"]:focus,
561 input[type="search"]:focus,
567 border-color: {$colors['link_color']};
570 /* Main Text Color */
577 .social-navigation a,
582 .site-branding .site-title a,
584 .page-links > .page-links-title,
586 .comment-reply-title small a:hover,
587 .comment-reply-title small a:focus {
588 color: {$colors['main_text_color']};
592 .menu-toggle.toggled-on,
593 .menu-toggle.toggled-on:hover,
594 .menu-toggle.toggled-on:focus,
596 .post-navigation div + div,
602 .comment-reply-title {
603 border-color: {$colors['main_text_color']};
607 button[disabled]:hover,
608 button[disabled]:focus,
609 input[type="button"],
610 input[type="button"][disabled]:hover,
611 input[type="button"][disabled]:focus,
613 input[type="reset"][disabled]:hover,
614 input[type="reset"][disabled]:focus,
615 input[type="submit"],
616 input[type="submit"][disabled]:hover,
617 input[type="submit"][disabled]:focus,
618 .menu-toggle.toggled-on,
619 .menu-toggle.toggled-on:hover,
620 .menu-toggle.toggled-on:focus,
626 background-color: {$colors['main_text_color']};
629 /* Secondary Text Color */
632 * IE8 and earlier will drop any block with CSS3 selectors.
633 * Do not combine these styles with the next block.
635 body:not(.search-results) .entry-summary {
636 color: {$colors['secondary_text_color']};
640 .post-password-form label,
644 .post-navigation .meta-nav,
647 .widget_recent_entries .post-date,
648 .widget_rss .rss-date,
655 .taxonomy-description,
658 .pingback .edit-link,
660 .pingback .comment-edit-link,
663 .comment-awaiting-moderation,
668 .wp-caption .wp-caption-text,
671 .widecolumn .mu_register label {
672 color: {$colors['secondary_text_color']};
675 .widget_calendar tbody a:hover,
676 .widget_calendar tbody a:focus {
677 background-color: {$colors['secondary_text_color']};
691 input[type="password"],
692 input[type="search"],
695 .main-navigation .primary-menu,
697 .dropdown-toggle:after,
698 .social-navigation a,
706 .comment-list article,
707 .comment-list .pingback,
708 .comment-list .trackback,
711 .widecolumn .mu_register .mu_alert {
712 border-color: {$colors['main_text_color']}; /* Fallback for IE7 and IE8 */
713 border-color: {$colors['border_color']};
718 background-color: {$colors['main_text_color']}; /* Fallback for IE7 and IE8 */
719 background-color: {$colors['border_color']};
722 @media screen and (min-width: 56.875em) {
723 .main-navigation li:hover > a,
724 .main-navigation li.focus > a {
725 color: {$colors['link_color']};
728 .main-navigation ul ul,
729 .main-navigation ul ul li {
730 border-color: {$colors['border_color']};
733 .main-navigation ul ul:before {
734 border-top-color: {$colors['border_color']};
735 border-bottom-color: {$colors['border_color']};
738 .main-navigation ul ul li {
739 background-color: {$colors['page_background_color']};
742 .main-navigation ul ul:after {
743 border-top-color: {$colors['page_background_color']};
744 border-bottom-color: {$colors['page_background_color']};
753 * Outputs an Underscore template for generating CSS for the color scheme.
755 * The template generates the css dynamically for instant display in the
756 * Customizer preview.
758 * @since Twenty Sixteen 1.0
760 function twentysixteen_color_scheme_css_template() {
762 'background_color' => '{{ data.background_color }}',
763 'page_background_color' => '{{ data.page_background_color }}',
764 'link_color' => '{{ data.link_color }}',
765 'main_text_color' => '{{ data.main_text_color }}',
766 'secondary_text_color' => '{{ data.secondary_text_color }}',
767 'border_color' => '{{ data.border_color }}',
770 <script type="text/html" id="tmpl-twentysixteen-color-scheme">
771 <?php echo twentysixteen_get_color_scheme_css( $colors ); ?>
775 add_action( 'customize_controls_print_footer_scripts', 'twentysixteen_color_scheme_css_template' );
778 * Enqueues front-end CSS for the page background color.
780 * @since Twenty Sixteen 1.0
782 * @see wp_add_inline_style()
784 function twentysixteen_page_background_color_css() {
785 $color_scheme = twentysixteen_get_color_scheme();
786 $default_color = $color_scheme[1];
787 $page_background_color = get_theme_mod( 'page_background_color', $default_color );
789 // Don't do anything if the current color is the default.
790 if ( $page_background_color === $default_color ) {
795 /* Custom Page Background Color */
797 background-color: %1$s;
803 button[disabled]:hover,
804 button[disabled]:focus,
805 input[type="button"],
806 input[type="button"][disabled]:hover,
807 input[type="button"][disabled]:focus,
809 input[type="reset"][disabled]:hover,
810 input[type="reset"][disabled]:focus,
811 input[type="submit"],
812 input[type="submit"][disabled]:hover,
813 input[type="submit"][disabled]:focus,
814 .menu-toggle.toggled-on,
815 .menu-toggle.toggled-on:hover,
816 .menu-toggle.toggled-on:focus,
819 .pagination .prev:hover,
820 .pagination .prev:focus,
821 .pagination .next:hover,
822 .pagination .next:focus,
823 .pagination .nav-links:before,
824 .pagination .nav-links:after,
825 .widget_calendar tbody a,
826 .widget_calendar tbody a:hover,
827 .widget_calendar tbody a:focus,
830 .page-links a:focus {
834 @media screen and (min-width: 56.875em) {
835 .main-navigation ul ul li {
836 background-color: %1$s;
839 .main-navigation ul ul:after {
840 border-top-color: %1$s;
841 border-bottom-color: %1$s;
846 wp_add_inline_style( 'twentysixteen-style', sprintf( $css, $page_background_color ) );
848 add_action( 'wp_enqueue_scripts', 'twentysixteen_page_background_color_css', 11 );
851 * Enqueues front-end CSS for the link color.
853 * @since Twenty Sixteen 1.0
855 * @see wp_add_inline_style()
857 function twentysixteen_link_color_css() {
858 $color_scheme = twentysixteen_get_color_scheme();
859 $default_color = $color_scheme[2];
860 $link_color = get_theme_mod( 'link_color', $default_color );
862 // Don't do anything if the current color is the default.
863 if ( $link_color === $default_color ) {
868 /* Custom Link Color */
872 .main-navigation a:hover,
873 .main-navigation a:focus,
874 .dropdown-toggle:hover,
875 .dropdown-toggle:focus,
876 .social-navigation a:hover:before,
877 .social-navigation a:focus:before,
878 .post-navigation a:hover .post-title,
879 .post-navigation a:focus .post-title,
882 .site-branding .site-title a:hover,
883 .site-branding .site-title a:focus,
884 .entry-title a:hover,
885 .entry-title a:focus,
886 .entry-footer a:hover,
887 .entry-footer a:focus,
888 .comment-metadata a:hover,
889 .comment-metadata a:focus,
890 .pingback .comment-edit-link:hover,
891 .pingback .comment-edit-link:focus,
893 .comment-reply-link:hover,
894 .comment-reply-link:focus,
905 input[type="button"]:hover,
906 input[type="button"]:focus,
907 input[type="reset"]:hover,
908 input[type="reset"]:focus,
909 input[type="submit"]:hover,
910 input[type="submit"]:focus,
911 .pagination .prev:hover,
912 .pagination .prev:focus,
913 .pagination .next:hover,
914 .pagination .next:focus,
915 .widget_calendar tbody a,
917 .page-links a:focus {
918 background-color: %1$s;
921 input[type="text"]:focus,
922 input[type="email"]:focus,
923 input[type="url"]:focus,
924 input[type="password"]:focus,
925 input[type="search"]:focus,
934 @media screen and (min-width: 56.875em) {
935 .main-navigation li:hover > a,
936 .main-navigation li.focus > a {
942 wp_add_inline_style( 'twentysixteen-style', sprintf( $css, $link_color ) );
944 add_action( 'wp_enqueue_scripts', 'twentysixteen_link_color_css', 11 );
947 * Enqueues front-end CSS for the main text color.
949 * @since Twenty Sixteen 1.0
951 * @see wp_add_inline_style()
953 function twentysixteen_main_text_color_css() {
954 $color_scheme = twentysixteen_get_color_scheme();
955 $default_color = $color_scheme[3];
956 $main_text_color = get_theme_mod( 'main_text_color', $default_color );
958 // Don't do anything if the current color is the default.
959 if ( $main_text_color === $default_color ) {
963 // Convert main text hex color to rgba.
964 $main_text_color_rgb = twentysixteen_hex2rgb( $main_text_color );
966 // If the rgba values are empty return early.
967 if ( empty( $main_text_color_rgb ) ) {
971 // If we get this far, we have a custom color scheme.
972 $border_color = vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.2)', $main_text_color_rgb );
975 /* Custom Main Text Color */
982 .social-navigation a,
987 .site-branding .site-title a,
989 .page-links > .page-links-title,
991 .comment-reply-title small a:hover,
992 .comment-reply-title small a:focus {
997 .menu-toggle.toggled-on,
998 .menu-toggle.toggled-on:hover,
999 .menu-toggle.toggled-on:focus,
1001 .post-navigation div + div,
1007 .comment-reply-title {
1012 button[disabled]:hover,
1013 button[disabled]:focus,
1014 input[type="button"],
1015 input[type="button"][disabled]:hover,
1016 input[type="button"][disabled]:focus,
1017 input[type="reset"],
1018 input[type="reset"][disabled]:hover,
1019 input[type="reset"][disabled]:focus,
1020 input[type="submit"],
1021 input[type="submit"][disabled]:hover,
1022 input[type="submit"][disabled]:focus,
1023 .menu-toggle.toggled-on,
1024 .menu-toggle.toggled-on:hover,
1025 .menu-toggle.toggled-on:focus,
1031 background-color: %1$s;
1043 input[type="email"],
1045 input[type="password"],
1046 input[type="search"],
1048 .main-navigation li,
1049 .main-navigation .primary-menu,
1051 .dropdown-toggle:after,
1052 .social-navigation a,
1054 .comment-navigation,
1060 .comment-list article,
1061 .comment-list .pingback,
1062 .comment-list .trackback,
1063 .comment-reply-link,
1065 .widecolumn .mu_register .mu_alert {
1066 border-color: %1$s; /* Fallback for IE7 and IE8 */
1072 background-color: %1$s; /* Fallback for IE7 and IE8 */
1073 background-color: %2$s;
1076 @media screen and (min-width: 56.875em) {
1077 .main-navigation ul ul,
1078 .main-navigation ul ul li {
1082 .main-navigation ul ul:before {
1083 border-top-color: %2$s;
1084 border-bottom-color: %2$s;
1089 wp_add_inline_style( 'twentysixteen-style', sprintf( $css, $main_text_color, $border_color ) );
1091 add_action( 'wp_enqueue_scripts', 'twentysixteen_main_text_color_css', 11 );
1094 * Enqueues front-end CSS for the secondary text color.
1096 * @since Twenty Sixteen 1.0
1098 * @see wp_add_inline_style()
1100 function twentysixteen_secondary_text_color_css() {
1101 $color_scheme = twentysixteen_get_color_scheme();
1102 $default_color = $color_scheme[4];
1103 $secondary_text_color = get_theme_mod( 'secondary_text_color', $default_color );
1105 // Don't do anything if the current color is the default.
1106 if ( $secondary_text_color === $default_color ) {
1111 /* Custom Secondary Text Color */
1114 * IE8 and earlier will drop any block with CSS3 selectors.
1115 * Do not combine these styles with the next block.
1117 body:not(.search-results) .entry-summary {
1122 .post-password-form label,
1126 .post-navigation .meta-nav,
1128 .comment-navigation,
1129 .widget_recent_entries .post-date,
1130 .widget_rss .rss-date,
1137 .taxonomy-description,
1140 .pingback .edit-link,
1141 .comment-metadata a,
1142 .pingback .comment-edit-link,
1143 .comment-form label,
1145 .comment-awaiting-moderation,
1150 .wp-caption .wp-caption-text,
1153 .widecolumn .mu_register label {
1157 .widget_calendar tbody a:hover,
1158 .widget_calendar tbody a:focus {
1159 background-color: %1$s;
1163 wp_add_inline_style( 'twentysixteen-style', sprintf( $css, $secondary_text_color ) );
1165 add_action( 'wp_enqueue_scripts', 'twentysixteen_secondary_text_color_css', 11 );