twentyfifteen_get_color_scheme_css

Returns CSS for the color schemes.

Description

(string) twentyfifteen_get_color_scheme_css( (array) $colors ); 

Returns (string)

Color scheme CSS.

Parameters (1)

0. $colors (array)
Color scheme colors.

Usage

  1. if ( !function_exists( 'twentyfifteen_get_color_scheme_css' ) ) { 
  2. require_once '/inc/customizer.php'; 
  3.  
  4. // Color scheme colors. 
  5. $colors = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = twentyfifteen_get_color_scheme_css($colors); 
  9.  

Defined (1)

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

/inc/customizer.php  
  1. function twentyfifteen_get_color_scheme_css( $colors ) { 
  2. $colors = wp_parse_args( $colors, array( 
  3. 'background_color' => '',  
  4. 'header_background_color' => '',  
  5. 'box_background_color' => '',  
  6. 'textcolor' => '',  
  7. 'secondary_textcolor' => '',  
  8. 'border_color' => '',  
  9. 'border_focus_color' => '',  
  10. 'sidebar_textcolor' => '',  
  11. 'sidebar_border_color' => '',  
  12. 'sidebar_border_focus_color' => '',  
  13. 'secondary_sidebar_textcolor' => '',  
  14. 'meta_box_background_color' => '',  
  15. ) ); 
  16.  
  17. $css = <<<CSS 
  18. /* Color Scheme */ 
  19.  
  20. /* Background Color */ 
  21. body { 
  22. background-color: {$colors['background_color']}; 
  23.  
  24. /* Sidebar Background Color */ 
  25. body:before,  
  26. .site-header { 
  27. background-color: {$colors['header_background_color']}; 
  28.  
  29. /* Box Background Color */ 
  30. .post-navigation,  
  31. .pagination,  
  32. .secondary,  
  33. .site-footer,  
  34. .hentry,  
  35. .page-header,  
  36. .page-content,  
  37. .comments-area,  
  38. .widecolumn { 
  39. background-color: {$colors['box_background_color']}; 
  40.  
  41. /* Box Background Color */ 
  42. button,  
  43. input[type="button"],  
  44. input[type="reset"],  
  45. input[type="submit"],  
  46. .pagination .prev,  
  47. .pagination .next,  
  48. .widget_calendar tbody a,  
  49. .widget_calendar tbody a:hover,  
  50. .widget_calendar tbody a:focus,  
  51. .page-links a,  
  52. .page-links a:hover,  
  53. .page-links a:focus,  
  54. .sticky-post { 
  55. color: {$colors['box_background_color']}; 
  56.  
  57. /* Main Text Color */ 
  58. button,  
  59. input[type="button"],  
  60. input[type="reset"],  
  61. input[type="submit"],  
  62. .pagination .prev,  
  63. .pagination .next,  
  64. .widget_calendar tbody a,  
  65. .page-links a,  
  66. .sticky-post { 
  67. background-color: {$colors['textcolor']}; 
  68.  
  69. /* Main Text Color */ 
  70. body,  
  71. blockquote cite,  
  72. blockquote small,  
  73. a,  
  74. .dropdown-toggle:after,  
  75. .image-navigation a:hover,  
  76. .image-navigation a:focus,  
  77. .comment-navigation a:hover,  
  78. .comment-navigation a:focus,  
  79. .widget-title,  
  80. .entry-footer a:hover,  
  81. .entry-footer a:focus,  
  82. .comment-metadata a:hover,  
  83. .comment-metadata a:focus,  
  84. .pingback .edit-link a:hover,  
  85. .pingback .edit-link a:focus,  
  86. .comment-list .reply a:hover,  
  87. .comment-list .reply a:focus,  
  88. .site-info a:hover,  
  89. .site-info a:focus { 
  90. color: {$colors['textcolor']}; 
  91.  
  92. /* Main Text Color */ 
  93. .entry-content a,  
  94. .entry-summary a,  
  95. .page-content a,  
  96. .comment-content a,  
  97. .pingback .comment-body > a,  
  98. .author-description a,  
  99. .taxonomy-description a,  
  100. .textwidget a,  
  101. .entry-footer a:hover,  
  102. .comment-metadata a:hover,  
  103. .pingback .edit-link a:hover,  
  104. .comment-list .reply a:hover,  
  105. .site-info a:hover { 
  106. border-color: {$colors['textcolor']}; 
  107.  
  108. /* Secondary Text Color */ 
  109. button:hover,  
  110. button:focus,  
  111. input[type="button"]:hover,  
  112. input[type="button"]:focus,  
  113. input[type="reset"]:hover,  
  114. input[type="reset"]:focus,  
  115. input[type="submit"]:hover,  
  116. input[type="submit"]:focus,  
  117. .pagination .prev:hover,  
  118. .pagination .prev:focus,  
  119. .pagination .next:hover,  
  120. .pagination .next:focus,  
  121. .widget_calendar tbody a:hover,  
  122. .widget_calendar tbody a:focus,  
  123. .page-links a:hover,  
  124. .page-links a:focus { 
  125. background-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */ 
  126. background-color: {$colors['secondary_textcolor']}; 
  127.  
  128. /* Secondary Text Color */ 
  129. blockquote,  
  130. a:hover,  
  131. a:focus,  
  132. .main-navigation .menu-item-description,  
  133. .post-navigation .meta-nav,  
  134. .post-navigation a:hover .post-title,  
  135. .post-navigation a:focus .post-title,  
  136. .image-navigation,  
  137. .image-navigation a,  
  138. .comment-navigation,  
  139. .comment-navigation a,  
  140. .widget,  
  141. .author-heading,  
  142. .entry-footer,  
  143. .entry-footer a,  
  144. .taxonomy-description,  
  145. .page-links > .page-links-title,  
  146. .entry-caption,  
  147. .comment-author,  
  148. .comment-metadata,  
  149. .comment-metadata a,  
  150. .pingback .edit-link,  
  151. .pingback .edit-link a,  
  152. .post-password-form label,  
  153. .comment-form label,  
  154. .comment-notes,  
  155. .comment-awaiting-moderation,  
  156. .logged-in-as,  
  157. .form-allowed-tags,  
  158. .no-comments,  
  159. .site-info,  
  160. .site-info a,  
  161. .wp-caption-text,  
  162. .gallery-caption,  
  163. .comment-list .reply a,  
  164. .widecolumn label,  
  165. .widecolumn .mu_register label { 
  166. color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */ 
  167. color: {$colors['secondary_textcolor']}; 
  168.  
  169. /* Secondary Text Color */ 
  170. blockquote,  
  171. .logged-in-as a:hover,  
  172. .comment-author a:hover { 
  173. border-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */ 
  174. border-color: {$colors['secondary_textcolor']}; 
  175.  
  176. /* Border Color */ 
  177. hr,  
  178. .dropdown-toggle:hover,  
  179. .dropdown-toggle:focus { 
  180. background-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */ 
  181. background-color: {$colors['border_color']}; 
  182.  
  183. /* Border Color */ 
  184. pre,  
  185. abbr[title],  
  186. table,  
  187. th,  
  188. td,  
  189. input,  
  190. textarea,  
  191. .main-navigation ul,  
  192. .main-navigation li,  
  193. .post-navigation,  
  194. .post-navigation div + div,  
  195. .pagination,  
  196. .comment-navigation,  
  197. .widget li,  
  198. .widget_categories .children,  
  199. .widget_nav_menu .sub-menu,  
  200. .widget_pages .children,  
  201. .site-header,  
  202. .site-footer,  
  203. .hentry + .hentry,  
  204. .author-info,  
  205. .entry-content .page-links a,  
  206. .page-links > span,  
  207. .page-header,  
  208. .comments-area,  
  209. .comment-list + .comment-respond,  
  210. .comment-list article,  
  211. .comment-list .pingback,  
  212. .comment-list .trackback,  
  213. .comment-list .reply a,  
  214. .no-comments { 
  215. border-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */ 
  216. border-color: {$colors['border_color']}; 
  217.  
  218. /* Border Focus Color */ 
  219. a:focus,  
  220. button:focus,  
  221. input:focus { 
  222. outline-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */ 
  223. outline-color: {$colors['border_focus_color']}; 
  224.  
  225. input:focus,  
  226. textarea:focus { 
  227. border-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */ 
  228. border-color: {$colors['border_focus_color']}; 
  229.  
  230. /* Sidebar Link Color */ 
  231. .secondary-toggle:before { 
  232. color: {$colors['sidebar_textcolor']}; 
  233.  
  234. .site-title a,  
  235. .site-description { 
  236. color: {$colors['sidebar_textcolor']}; 
  237.  
  238. /* Sidebar Text Color */ 
  239. .site-title a:hover,  
  240. .site-title a:focus { 
  241. color: {$colors['secondary_sidebar_textcolor']}; 
  242.  
  243. /* Sidebar Border Color */ 
  244. .secondary-toggle { 
  245. border-color: {$colors['sidebar_textcolor']}; /* Fallback for IE7 and IE8 */ 
  246. border-color: {$colors['sidebar_border_color']}; 
  247.  
  248. /* Sidebar Border Focus Color */ 
  249. .secondary-toggle:hover,  
  250. .secondary-toggle:focus { 
  251. border-color: {$colors['sidebar_textcolor']}; /* Fallback for IE7 and IE8 */ 
  252. border-color: {$colors['sidebar_border_focus_color']}; 
  253.  
  254. .site-title a { 
  255. outline-color: {$colors['sidebar_textcolor']}; /* Fallback for IE7 and IE8 */ 
  256. outline-color: {$colors['sidebar_border_focus_color']}; 
  257.  
  258. /* Meta Background Color */ 
  259. .entry-footer { 
  260. background-color: {$colors['meta_box_background_color']}; 
  261.  
  262. @media screen and (min-width: 38.75em) { 
  263. /* Main Text Color */ 
  264. .page-header { 
  265. border-color: {$colors['textcolor']}; 
  266.  
  267. @media screen and (min-width: 59.6875em) { 
  268. /* Make sure its transparent on desktop */ 
  269. .site-header,  
  270. .secondary { 
  271. background-color: transparent; 
  272.  
  273. /* Sidebar Background Color */ 
  274. .widget button,  
  275. .widget input[type="button"],  
  276. .widget input[type="reset"],  
  277. .widget input[type="submit"],  
  278. .widget_calendar tbody a,  
  279. .widget_calendar tbody a:hover,  
  280. .widget_calendar tbody a:focus { 
  281. color: {$colors['header_background_color']}; 
  282.  
  283. /* Sidebar Link Color */ 
  284. .secondary a,  
  285. .dropdown-toggle:after,  
  286. .widget-title,  
  287. .widget blockquote cite,  
  288. .widget blockquote small { 
  289. color: {$colors['sidebar_textcolor']}; 
  290.  
  291. .widget button,  
  292. .widget input[type="button"],  
  293. .widget input[type="reset"],  
  294. .widget input[type="submit"],  
  295. .widget_calendar tbody a { 
  296. background-color: {$colors['sidebar_textcolor']}; 
  297.  
  298. .textwidget a { 
  299. border-color: {$colors['sidebar_textcolor']}; 
  300.  
  301. /* Sidebar Text Color */ 
  302. .secondary a:hover,  
  303. .secondary a:focus,  
  304. .main-navigation .menu-item-description,  
  305. .widget,  
  306. .widget blockquote,  
  307. .widget .wp-caption-text,  
  308. .widget .gallery-caption { 
  309. color: {$colors['secondary_sidebar_textcolor']}; 
  310.  
  311. .widget button:hover,  
  312. .widget button:focus,  
  313. .widget input[type="button"]:hover,  
  314. .widget input[type="button"]:focus,  
  315. .widget input[type="reset"]:hover,  
  316. .widget input[type="reset"]:focus,  
  317. .widget input[type="submit"]:hover,  
  318. .widget input[type="submit"]:focus,  
  319. .widget_calendar tbody a:hover,  
  320. .widget_calendar tbody a:focus { 
  321. background-color: {$colors['secondary_sidebar_textcolor']}; 
  322.  
  323. .widget blockquote { 
  324. border-color: {$colors['secondary_sidebar_textcolor']}; 
  325.  
  326. /* Sidebar Border Color */ 
  327. .main-navigation ul,  
  328. .main-navigation li,  
  329. .widget input,  
  330. .widget textarea,  
  331. .widget table,  
  332. .widget th,  
  333. .widget td,  
  334. .widget pre,  
  335. .widget li,  
  336. .widget_categories .children,  
  337. .widget_nav_menu .sub-menu,  
  338. .widget_pages .children,  
  339. .widget abbr[title] { 
  340. border-color: {$colors['sidebar_border_color']}; 
  341.  
  342. .dropdown-toggle:hover,  
  343. .dropdown-toggle:focus,  
  344. .widget hr { 
  345. background-color: {$colors['sidebar_border_color']}; 
  346.  
  347. .widget input:focus,  
  348. .widget textarea:focus { 
  349. border-color: {$colors['sidebar_border_focus_color']}; 
  350.  
  351. .sidebar a:focus,  
  352. .dropdown-toggle:focus { 
  353. outline-color: {$colors['sidebar_border_focus_color']}; 
  354. CSS; 
  355.  
  356. return $css;