wpcom-colors.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. <?php
  2. /**
  3. * Custom Colors: AltoFocus
  4. */
  5. /**
  6. * WHITE --------------------
  7. */
  8. add_color_rule( 'bg', '#ffffff', array(
  9. /* Background color, no contrast */
  10. array( 'html,
  11. body,
  12. button,
  13. #page a.button,
  14. input[type="button"],
  15. input[type="reset"],
  16. input[type="submit"],
  17. ins,
  18. mark,
  19. .dropdown-toggle,
  20. .hfeed #main .hentry.grid-item-featured:not(.has-post-thumbnail) .entry-header,
  21. .hfeed #main .hentry:not(.has-post-thumbnail) .entry-header,
  22. .hfeed #main .hentry .post-thumbnail:after,
  23. .site-header,
  24. .top-navigation > div,
  25. .menu-toggle,
  26. .single .entry-media,
  27. .site-content,
  28. #infinite-handle span button,
  29. .widget-area', 'background-color' ),
  30. /* Text color, link contrast */
  31. array( 'button:hover,
  32. #page a.button:hover,
  33. input[type="button"]:hover,
  34. input[type="reset"]:hover,
  35. input[type="submit"]:hover,
  36. #infinite-handle span button:hover,
  37. .comments-link:hover a,
  38. .dropdown-toggle.toggled-on:after,
  39. .dropdown-toggle:hover:after', 'color' ),
  40. /* Text color, link contrast */
  41. array( '.top-navigation .children li a,
  42. .top-navigation .sub-menu li a,
  43. .top-navigation div > ul li.toggled-on a,
  44. .hfeed #main .hentry.grid-item-featured .entry-header-wrap,
  45. .hfeed #main .hentry.grid-item-featured .entry-header-wrap .posted-on,
  46. .hfeed #main .hentry.grid-item-featured:hover.has-post-thumbnail .edit-link a', 'color', 'link', 5 ),
  47. /* Stroke color, contrast bg */
  48. array( '.dropdown-toggle.toggled-on .meta-nav .dropdown-icon .line,
  49. .dropdown-toggle:hover .meta-nav .dropdown-icon .line,
  50. .menu-toggle:hover .meta-nav .menu-icon .line,
  51. .post-navigation-fixed .nav-links a:hover .meta-nav .arrow-icon .arrow', 'stroke', 'link', 5 ),
  52. /* Fill color, contrast bg */
  53. array( '.comments-link .comment-icon .path,
  54. .post-navigation-fixed .nav-links a .meta-nav .arrow-icon .circle', 'fill' ),
  55. ), __( 'Background Color', 'altofocus' ) );
  56. /**
  57. * ORANGE --------------------
  58. */
  59. add_color_rule( 'txt', '#e38900', array(
  60. /* Background color, bg contrast */
  61. array( '#infinite-handle span button:hover,
  62. .dropdown-toggle.toggled-on,
  63. .dropdown-toggle:hover,
  64. button:hover,
  65. #page a.button:hover,
  66. input[type="button"]:hover,
  67. input[type="reset"]:hover,
  68. input[type="submit"]:hover', 'background-color', 'bg', 3 ),
  69. /* Background color, bg contrast */
  70. array( '.hfeed #main .hentry.grid-item-featured .post-thumbnail:after', 'background-color' ),
  71. /* Background color, .9 opacity */
  72. array( '.flex-control-paging li a:hover,
  73. .flex-control-paging li a.flex-active', 'background-color', 0.9 ),
  74. /* Border color, bg contrast */
  75. array( '#infinite-handle span button:hover,
  76. .dropdown-toggle.toggled-on,
  77. .dropdown-toggle:hover,
  78. button:hover,
  79. #page a.button:hover,
  80. input[type="button"]:hover,
  81. input[type="reset"]:hover,
  82. input[type="submit"]:hover', 'border-color', 'bg', 3 ),
  83. /* Border color, no contrast */
  84. array( '.comments-link:hover:after,
  85. .comments-link:hover:before', 'border-top-color' ),
  86. array( '.comments-link:hover:after,
  87. .comments-link:hover:before', 'border-left-color' ),
  88. /* Text color, bg contrast */
  89. array( 'a,
  90. a:active,
  91. a:hover,
  92. a:focus,
  93. a:visited,
  94. .flex-direction-nav a:hover .meta-nav:before,
  95. .hfeed #main .hentry .edit-link a,
  96. .hfeed #main .hentry.grid-item-featured:not(.has-post-thumbnail) .entry-header-wrap,
  97. .hfeed #main .hentry.grid-item-featured:not(.has-post-thumbnail) .entry-header-wrap .posted-on,
  98. .hfeed #main .hentry:not(.has-post-thumbnail) .entry-header-wrap,
  99. .hfeed #main .hentry:not(.has-post-thumbnail) .entry-header-wrap .posted-on,
  100. .hfeed #main .hentry .entry-header-wrap,
  101. .hfeed #main .hentry .entry-header-wrap .posted-on,
  102. .hfeed #main .hentry:hover.has-post-thumbnail .edit-link a', 'color', 'bg' ),
  103. /* Comments link fill, bg contrast */
  104. array( '.comments-link:hover .comment-icon .path,
  105. .post-navigation-fixed .nav-links a:hover .meta-nav .arrow-icon .circle', 'fill', 'bg', 3 ),
  106. /* Comments link stroke, bg contrast */
  107. array( '.comments-link:hover .comment-icon .path,
  108. .post-navigation-fixed .nav-links a:hover .meta-nav .arrow-icon .circle,
  109. .flex-direction-nav a:hover .meta-nav .arrow', 'stroke', 'bg', 3 ),
  110. ), __( 'Link Color', 'altofocus' ) );
  111. /**
  112. * LIGHT GREY --------------------
  113. */
  114. add_color_rule( 'link', '#888888', array(
  115. ), __( 'Category Color 1', 'altofocus' ) );
  116. /**
  117. * LIGHT GRAY --------------------
  118. */
  119. add_color_rule( 'fg1', '#888888', array(
  120. ), __( 'Category Color 1', 'altofocus' ) );
  121. /**
  122. * LIGHT GRAY --------------------
  123. */
  124. add_color_rule( 'extra', '#888888', array(
  125. /* Text color, contrast bg */
  126. array( '#respond p[class^="comment-form"] label,
  127. #secondary .widget-grofile .grofile-meta h4,
  128. #secondary .widget_calendar caption,
  129. #secondary .widget_search .screen-reader-text,
  130. .hfeed .page-header .page-title,
  131. .hfeed .page-header .taxonomy-description,
  132. .byline,
  133. .comment-body .comment-metadata a,
  134. .comment-body .fn,
  135. .comment-navigation .screen-reader-text,
  136. .comment-reply-title,
  137. .comment-respond p[class^="comment-form"] label,
  138. .comments-title,
  139. .highlander-enabled #respond label,
  140. .highlander-enabled #respond form label,
  141. .entry-footer,
  142. .hentry .entry-content > #jp-post-flair .jp-relatedposts-headline,
  143. .hentry .entry-content > #jp-post-flair .sd-title,
  144. .hentry .entry-content > .sd-sharing-enabled .jp-relatedposts-headline,
  145. .hentry .entry-content > .sd-sharing-enabled .sd-title,
  146. .post-navigation .screen-reader-text,
  147. .posted-on,
  148. .posts-navigation .screen-reader-text,
  149. .widget-title,
  150. cite', 'color', 'bg', 3 ),
  151. ), __( 'Hover Color', 'altofocus' ) );
  152. /**
  153. * DARK GRAY --------------------
  154. */
  155. add_color_rule( 'extra', '#111111', array(
  156. /* Text color, contrast bg */
  157. array( '#infinite-handle span button,
  158. .hfeed .page-header .page-title,
  159. .comment-body .fn,
  160. .comments-link a,
  161. .dropdown-toggle,
  162. .dropdown-toggle:after,
  163. .flex-direction-nav a .meta-nav:before,
  164. #content .comment-navigation .meta-nav,
  165. #content .post-navigation .meta-nav,
  166. #content .posts-navigation .meta-nav,
  167. body,
  168. button,
  169. .menu-toggle,
  170. #page a.button,
  171. input,
  172. input[type="button"],
  173. input[type="reset"],
  174. input[type="submit"],
  175. select,
  176. textarea', 'color', 'bg', 5 ),
  177. /* Border-color, transparent */
  178. array( '#infinite-handle span button,
  179. button,
  180. #page a.button,
  181. input[type="button"],
  182. input[type="reset"],
  183. input[type="submit"]', 'border-color', 0.2 ),
  184. /* Stroke color, transparent */
  185. array( '.comments-link .comment-icon .path,
  186. .post-navigation-fixed .nav-links a .meta-nav .arrow-icon .circle', 'stroke', 0.2 ),
  187. /* Stroke color, contrast bg */
  188. array( '.dropdown-toggle .meta-nav .dropdown-icon .line,
  189. .menu-toggle .meta-nav .menu-icon .line,
  190. .post-navigation-fixed .nav-links a .meta-nav .arrow-icon .arrow,
  191. .flex-direction-nav a .meta-nav .arrow-icon .arrow', 'stroke', 'bg', 5 ),
  192. /* Border-color, .5 opacity */
  193. array( '#secondary #flickr_badge_wrapper,
  194. .hfeed #main .hentry .entry-header,
  195. .hfeed #main .hentry:not(.has-post-thumbnail) .entry-header,
  196. .hfeed #main .hentry.grid-item-featured:not(.has-post-thumbnail) .entry-header', 'border-color', 'bg', 5 ),
  197. array( '.home .content-area,
  198. .blog .content-area,
  199. .hfeed .content-area,
  200. table,
  201. .top-navigation .sub-menu:before,
  202. .top-navigation .children:before,
  203. .top-navigation > div > ul,
  204. .comment-navigation,
  205. .posts-navigation,
  206. .post-navigation,
  207. .single .hentry:not(.has-post-thumbnail):before,
  208. .page .hentry.page:before,
  209. .comments-area,
  210. .no-comments,
  211. .comment-body,
  212. .pingback .comment-body,
  213. .trackback .comment-body,
  214. .page .site-content .comments-area:before,
  215. .single .comment-list,
  216. #respond,
  217. .comment-respond,
  218. .widget,
  219. .highlander-enabled #respond,
  220. #secondary,
  221. .site-footer', 'border-top-color', 'bg', 5 ),
  222. array( '.hfeed .hentry:before,
  223. table th,
  224. table td,
  225. .top-navigation li:after,
  226. .site-content', 'border-bottom-color', 'bg', 5 ),
  227. array( '.dropdown-toggle,
  228. .dropdown-toggle:active,
  229. .dropdown-toggle:focus', 'border-color', 0.2 ),
  230. ) );
  231. /**
  232. * MEDIUM GRAY --------------------
  233. */
  234. add_color_rule( 'extra', '#cccccc', array(
  235. /* Background color, contrast bg */
  236. array( 'hr', 'background-color', 'bg', 3 ),
  237. /* Background color, .5 opacity */
  238. array( '.flex-control-paging li a', 'background-color', 0.5 ),
  239. /* Text color, contrast bg */
  240. array( '.comment-navigation .meta-nav,
  241. .post-navigation .meta-nav,
  242. .posts-navigation .meta-nav', 'color', 'bg', 3 ),
  243. /* Border-color, contrast bg */
  244. array( '.hentry .entry-content > #jp-post-flair div#jp-relatedposts div.jp-relatedposts-items-visual .jp-relatedposts-post img.jp-relatedposts-post-img,
  245. .hentry .entry-content > #jp-post-flair div#jp-relatedposts div.jp-relatedposts-items-visual .jp-relatedposts-post span,
  246. .hentry .entry-content > .sd-sharing-enabled div#jp-relatedposts div.jp-relatedposts-items-visual .jp-relatedposts-post img.jp-relatedposts-post-img,
  247. .hentry .entry-content > .sd-sharing-enabled div#jp-relatedposts div.jp-relatedposts-items-visual .jp-relatedposts-post span,
  248. input[type="color"],
  249. input[type="date"],
  250. input[type="datetime"],
  251. input[type="datetime-local"],
  252. input[type="email"],
  253. input[type="month"],
  254. input[type="number"],
  255. input[type="password"],
  256. input[type="range"],
  257. input[type="search"],
  258. input[type="tel"],
  259. input[type="text"],
  260. input[type="time"],
  261. input[type="url"],
  262. input[type="week"],
  263. select,
  264. textarea', 'border-color', 'bg', 3 ),
  265. ) );
  266. /**
  267. * EXTRA CSS --------------------
  268. */
  269. function altofocus_extra_css() {
  270. $colors_array = get_theme_mod( 'colors_manager' );
  271. $bg = $colors_array['colors']['bg']; // White
  272. $link = $colors_array['colors']['txt']; // Orange
  273. $extra = $colors_array['colors']['extra']; // Light Gray
  274. /**
  275. * WHITE --------------------
  276. */
  277. ?>
  278. @media screen and (max-width: 37.5em) {
  279. /* background-color */
  280. .hfeed #main .hentry.grid-item-featured .entry-header-wrap,
  281. .hfeed #main .hentry.grid-item-featured .entry-header-wrap .posted-on,
  282. .hfeed #main .hentry.grid-item-featured .edit-link a {
  283. color: <?php echo $bg; ?>;
  284. }
  285. }
  286. @media screen and (min-width: 37.5em) {
  287. /* border-top-color */
  288. .top-navigation .children > li.toggled-on,
  289. .top-navigation .sub-menu > li.toggled-on,
  290. .top-navigation div > ul > li > .children,
  291. .top-navigation div > ul > li > .sub-menu {
  292. border-top-color: <?php echo $bg; ?>;
  293. }
  294. /* border-bottom-color */
  295. .top-navigation .children .children,
  296. .top-navigation .children .sub-menu,
  297. .top-navigation .sub-menu .children,
  298. .top-navigation .sub-menu .sub-menu {
  299. border-bottom-color: <?php echo $bg; ?>;
  300. }
  301. }
  302. <?php
  303. /**
  304. * ORANGE --------------------
  305. */
  306. ?>
  307. @media screen and (max-width: 37.5em) {
  308. /* background-color */
  309. .hfeed .hentry.grid-item-featured {
  310. background-color: <?php echo $link; ?>;
  311. }
  312. #masthead .top-navigation div > ul li a {
  313. color: <?php echo $link; ?>;
  314. }
  315. }
  316. @media screen and (min-width: 37.5em) {
  317. /* background-color */
  318. .top-navigation .children,
  319. .top-navigation .sub-menu,
  320. .top-navigation div > ul li.toggled-on {
  321. background-color: <?php echo $link; ?>;
  322. }
  323. }
  324. <?php
  325. }
  326. add_theme_support( 'custom_colors_extra_css', 'altofocus_extra_css' );
  327. /**
  328. * Additional color palettes
  329. */
  330. add_color_palette( array(
  331. '#f0eeec',
  332. '#325cb8'
  333. ), __( 'Beige on Blue', 'altofocus' ) );
  334. add_color_palette( array(
  335. '#ffffff',
  336. '#000000'
  337. ), __( 'Black on White', 'altofocus' ) );
  338. add_color_palette( array(
  339. '#000000',
  340. '#c44d58'
  341. ), __( 'Red on Black', 'altofocus' ) );
  342. add_color_palette( array(
  343. '#cecece',
  344. '#22a961'
  345. ), __( 'Purple on Tan', 'altofocus' ) );
  346. add_color_palette( array(
  347. '#1c3c59',
  348. '#ecaa91'
  349. ), __( 'Salmon on Navy Blue', 'altofocus' ) );
  350. add_color_palette( array(
  351. '#ffe5b2',
  352. '#b11623'
  353. ), __( 'Burgundy on Banana', 'altofocus' ) );