twentyfifteen_sidebar_text_color_css

Enqueues front-end CSS for the sidebar text color.

Description

twentyfifteen_sidebar_text_color_css(); 

Usage

  1. if ( !function_exists( 'twentyfifteen_sidebar_text_color_css' ) ) { 
  2. require_once '/inc/custom-header.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = twentyfifteen_sidebar_text_color_css(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc/custom-header.php  
  1. function twentyfifteen_sidebar_text_color_css() { 
  2. $color_scheme = twentyfifteen_get_color_scheme(); 
  3. $default_color = $color_scheme[4]; 
  4. $sidebar_link_color = get_theme_mod( 'sidebar_textcolor', $default_color ); 
  5.  
  6. // Don't do anything if the current color is the default. 
  7. if ( $sidebar_link_color === $default_color ) { 
  8. return; 
  9.  
  10. // If we get this far, we have custom styles. Let's do this. 
  11. $sidebar_link_color_rgb = twentyfifteen_hex2rgb( $sidebar_link_color ); 
  12. $sidebar_text_color = vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.7)', $sidebar_link_color_rgb ); 
  13. $sidebar_border_color = vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.1)', $sidebar_link_color_rgb ); 
  14. $sidebar_border_focus_color = vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.3)', $sidebar_link_color_rgb ); 
  15.  
  16. $css = ' 
  17. /* Custom Sidebar Text Color */ 
  18. .site-title a,  
  19. .site-description,  
  20. .secondary-toggle:before { 
  21. color: %1$s; 
  22.  
  23. .site-title a:hover,  
  24. .site-title a:focus { 
  25. color: %1$s; /* Fallback for IE7 and IE8 */ 
  26. color: %2$s; 
  27.  
  28. .secondary-toggle { 
  29. border-color: %1$s; /* Fallback for IE7 and IE8 */ 
  30. border-color: %3$s; 
  31.  
  32. .secondary-toggle:hover,  
  33. .secondary-toggle:focus { 
  34. border-color: %1$s; /* Fallback for IE7 and IE8 */ 
  35. border-color: %4$s; 
  36.  
  37. .site-title a { 
  38. outline-color: %1$s; /* Fallback for IE7 and IE8 */ 
  39. outline-color: %4$s; 
  40.  
  41. @media screen and (min-width: 59.6875em) { 
  42. .secondary a,  
  43. .dropdown-toggle:after,  
  44. .widget-title,  
  45. .widget blockquote cite,  
  46. .widget blockquote small { 
  47. color: %1$s; 
  48.  
  49. .widget button,  
  50. .widget input[type="button"],  
  51. .widget input[type="reset"],  
  52. .widget input[type="submit"],  
  53. .widget_calendar tbody a { 
  54. background-color: %1$s; 
  55.  
  56. .textwidget a { 
  57. border-color: %1$s; 
  58.  
  59. .secondary a:hover,  
  60. .secondary a:focus,  
  61. .main-navigation .menu-item-description,  
  62. .widget,  
  63. .widget blockquote,  
  64. .widget .wp-caption-text,  
  65. .widget .gallery-caption { 
  66. color: %2$s; 
  67.  
  68. .widget button:hover,  
  69. .widget button:focus,  
  70. .widget input[type="button"]:hover,  
  71. .widget input[type="button"]:focus,  
  72. .widget input[type="reset"]:hover,  
  73. .widget input[type="reset"]:focus,  
  74. .widget input[type="submit"]:hover,  
  75. .widget input[type="submit"]:focus,  
  76. .widget_calendar tbody a:hover,  
  77. .widget_calendar tbody a:focus { 
  78. background-color: %2$s; 
  79.  
  80. .widget blockquote { 
  81. border-color: %2$s; 
  82.  
  83. .main-navigation ul,  
  84. .main-navigation li,  
  85. .secondary-toggle,  
  86. .widget input,  
  87. .widget textarea,  
  88. .widget table,  
  89. .widget th,  
  90. .widget td,  
  91. .widget pre,  
  92. .widget li,  
  93. .widget_categories .children,  
  94. .widget_nav_menu .sub-menu,  
  95. .widget_pages .children,  
  96. .widget abbr[title] { 
  97. border-color: %3$s; 
  98.  
  99. .dropdown-toggle:hover,  
  100. .dropdown-toggle:focus,  
  101. .widget hr { 
  102. background-color: %3$s; 
  103.  
  104. .widget input:focus,  
  105. .widget textarea:focus { 
  106. border-color: %4$s; 
  107.  
  108. .sidebar a:focus,  
  109. .dropdown-toggle:focus { 
  110. outline-color: %4$s; 
  111. '; 
  112.  
  113. wp_add_inline_style( 'twentyfifteen-style', sprintf( $css, $sidebar_link_color, $sidebar_text_color, $sidebar_border_color, $sidebar_border_focus_color ) );