wpcom-colors.php 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. <?php
  2. /**
  3. * Background color
  4. * - Default: white
  5. * - Used for all backgrounds
  6. */
  7. add_color_rule( 'bg', '#ffffff', array(
  8. // Background color, no contrast
  9. array(
  10. 'body,
  11. button,
  12. input[type="button"],
  13. input[type="reset"],
  14. input[type="submit"],
  15. ins,
  16. mark,
  17. .main-navigation .children,
  18. .main-navigation .sub-menu,
  19. .main-navigation > div,
  20. .menu-toggle,
  21. .menu-toggle:focus,
  22. .entry-image .entry-image-caption,
  23. #infinite-handle span button,
  24. .comment .comment-reply-title a', 'background-color' ),
  25. // Border color, no contrast
  26. array(
  27. '.card:hover .entry-header,
  28. .card .entry-title a:hover,
  29. .card:hover .entry-title a:hover', 'border-color' ),
  30. // Text color, no contrast
  31. array(
  32. 'button:active,
  33. button:focus,
  34. button:hover,
  35. input[type="button"]:active,
  36. input[type="button"]:focus,
  37. input[type="button"]:hover,
  38. input[type="reset"]:active,
  39. input[type="reset"]:focus,
  40. input[type="reset"]:hover,
  41. input[type="submit"]:active,
  42. input[type="submit"]:focus,
  43. input[type="submit"]:hover,
  44. pre,
  45. .page-links a:hover,
  46. .posts-navigation a:active,
  47. .posts-navigation a:hover,
  48. .site-feature .entry-header .entry-categories:after,
  49. .site-feature .entry-header .entry-meta,
  50. .site-feature .entry-header .entry-meta a,
  51. .site-feature .entry-header .entry-meta a:active,
  52. .site-feature .entry-header .entry-meta a:hover,
  53. .site-feature .entry-header .entry-summary,
  54. .site-feature .entry-header .entry-title a,
  55. .site-feature .entry-header a,
  56. .card:hover,
  57. .card:hover a,
  58. .card:hover a:active,
  59. .card:hover a:hover,
  60. .card:hover .entry-meta,
  61. .card:hover .entry-meta > span:after,
  62. .card:hover .sd-rating h3.sd-title,
  63. #infinite-handle span button:active,
  64. #infinite-handle span button:focus,
  65. #infinite-handle span button:hover,
  66. .widget_tag_cloud a[style]:active,
  67. .widget_tag_cloud a[style]:hover', 'color' ),
  68. ),
  69. __( 'Background color' ) );
  70. /**
  71. * Text and Border Colors
  72. * - Default: black
  73. * - Used for buttons, general rules and borders
  74. */
  75. add_color_rule( 'txt', '#000000', array(
  76. // Background Color, bg contrast, less contrast to match #CCC
  77. array(
  78. 'button:active,
  79. button:focus,
  80. button:hover,
  81. input[type="button"]:active,
  82. input[type="button"]:focus,
  83. input[type="button"]:hover,
  84. input[type="reset"]:active,
  85. input[type="reset"]:focus,
  86. input[type="reset"]:hover,
  87. input[type="submit"]:active,
  88. input[type="submit"]:focus,
  89. input[type="submit"]:hover,
  90. hr,
  91. pre,
  92. .site-feature .entry-image-link,
  93. .card .entry-image,
  94. #infinite-handle span button:active,
  95. #infinite-handle span button:focus,
  96. #infinite-handle span button:hover,
  97. .page-links a:hover,
  98. .posts-navigation a:active,
  99. .posts-navigation a:hover,
  100. .widget_tag_cloud a[style]:active,
  101. .widget_tag_cloud a[style]:hover', 'background-color', 'bg' ),
  102. // Background Color, bg contrast, more contrast to match #555
  103. array(
  104. '.site-feature .entry-header', 'background-color', 'bg', 8 ),
  105. // Border Color, bg contrast
  106. array(
  107. 'button,
  108. input[type="button"],
  109. input[type="email"],
  110. input[type="password"],
  111. input[type="reset"],
  112. input[type="search"],
  113. input[type="submit"],
  114. input[type="text"],
  115. input[type="url"],
  116. textarea,
  117. .site-heading,
  118. .site-branding,
  119. .site-footer,
  120. .site-main .comment-navigation .nav-links,
  121. .main-navigation .children,
  122. .main-navigation .sub-menu,
  123. .main-navigation .menu-item-has-children:hover,
  124. .main-navigation .page_item_has_children:hover,
  125. .main-navigation div > ul ul,
  126. .main-navigation ul ul > li:hover,
  127. .archive .page-header .page-title,
  128. .comment-respond p input,
  129. .comment-respond p textarea,
  130. .page-links a,
  131. .posts-navigation a,
  132. .search .page-header .page-title,
  133. .widget_tag_cloud a[style],
  134. .wpcom-reblog-snapshot .reblog-post,
  135. .entry-image .entry-image-caption,
  136. .main-navigation div > ul:last-child,
  137. .main-navigation div > ul:first-child,
  138. .page .page,
  139. .pingback .comment-body,
  140. .search .page-header,
  141. .search-no-results .page-content,
  142. .single #page .site-main,
  143. .single .site-main .post-navigation,
  144. .single-jetpack-portfolio .hentry,
  145. .archive .page-header,
  146. .author-meta,
  147. .card .entry-header,
  148. .card .entry-image-section,
  149. .comments-area,
  150. .entry-author,
  151. .error404 .not-found,
  152. #infinite-handle span button,
  153. #infinite-handle span button:active,
  154. #infinite-handle span button:focus,
  155. #infinite-handle span button:hover,
  156. #secondary', 'border-color', 'bg' ),
  157. // Border Color, bg contrast, less contrast to match #CCC
  158. array(
  159. '.single .site-main > .post-navigation,
  160. .site-main .comment-navigation .nav-links,
  161. .pingback .comment-body', 'border-color', 'bg', 2 ),
  162. // Border Color, bg contrast, more contrast to match #999
  163. array(
  164. '.main-navigation .sub-menu:before,
  165. .main-navigation .children:before,
  166. .main-navigation li:after,
  167. .main-navigation li:after,
  168. .dropdown-toggle,
  169. .comment .children .comment-body,
  170. .comment .comment-body,
  171. .comment-content td,
  172. .comment-content th,
  173. .comment-content tr,
  174. .single div#respond,
  175. .comment-respond,
  176. .no-comments,
  177. .entry-content tbody td,
  178. .entry-content tbody th,
  179. .entry-content tbody tr,
  180. .widget_calendar tbody td,
  181. .widget_calendar tbody th,
  182. .widget_calendar tbody tr', 'border-color', 'bg', 12 ),
  183. // Text Color, bg contrast
  184. array(
  185. 'a,
  186. a:visited,
  187. input[type="email"]:focus,
  188. input[type="password"]:focus,
  189. input[type="search"]:focus,
  190. input[type="text"]:focus,
  191. input[type="url"]:focus,
  192. mark,
  193. textarea:focus,
  194. .entry-content a:active,
  195. .entry-content a:hover,
  196. .entry-title a,
  197. .site-title a,
  198. .site-description,
  199. .main-navigation ul > li a,
  200. .dropdown-toggle:after,
  201. .comment-content a:active,
  202. .comment-content a:hover,
  203. .widget_calendar table a:active,
  204. .widget_calendar table a:hover', 'color', 'bg' ),
  205. // Text Color, bg contrast, less contrast to match #CCC
  206. array(
  207. '.comment-navigation .nav-next:after,
  208. .comment-navigation .nav-previous:after,
  209. .entry-meta > span:after,
  210. .post-navigation .nav-next:after,
  211. .post-navigation .nav-previous:after', 'color', 'bg', 2 ),
  212. // Text Color, bg contrast, with lowered opacity
  213. array(
  214. 'body,
  215. button,
  216. input,
  217. select,
  218. textarea,
  219. .entry-meta a,
  220. footer.entry-meta a:hover,
  221. footer.entry-meta a:active,
  222. div.sharedaddy h3.sd-title,
  223. div#jp-relatedposts h3.jp-relatedposts-headline em', 'color', 'bg', 2 ),
  224. // Text Color, bg contrast, more contrast to match #999
  225. array(
  226. '.archive .taxonomy-description,
  227. .comment-metadata a,
  228. .entry-image .entry-image-caption,
  229. .entry-meta,
  230. .gallery-caption,
  231. .pingback .comment-body,
  232. .search .taxonomy-description,
  233. .widget_calendar tbody,
  234. .wp-caption .wp-caption-text', 'color', 'bg', 12 ),
  235. ),
  236. __( 'Text and Border Colors' ) );
  237. /**
  238. * Link color
  239. * - Default: red
  240. * - Used for link hover states, primary menu hover states, and buttons
  241. */
  242. add_color_rule( 'link', '#f35029', array(
  243. // Background Color, bg contrast
  244. array(
  245. '.card:hover', 'background-color', 'bg' ),
  246. // Border Color, bg contrast
  247. array(
  248. '.dropdown-toggle:hover,
  249. .dropdown-toggle.toggled-on,
  250. .comment-content blockquote,
  251. .comment-content q,
  252. .entry-content blockquote,
  253. .entry-content q,
  254. .card .entry-title a:hover', 'border-color', 'bg' ),
  255. // Text Color, bg contrast
  256. array(
  257. 'a:active,
  258. a:focus,
  259. a:hover,
  260. button,
  261. footer.entry-meta a,
  262. input[type="button"],
  263. input[type="email"],
  264. input[type="password"],
  265. input[type="reset"],
  266. input[type="search"],
  267. input[type="submit"],
  268. input[type="text"],
  269. input[type="url"],
  270. textarea,
  271. .site-title a:hover,
  272. .main-navigation .children li:hover:before,
  273. .main-navigation .sub-menu li:hover:before,
  274. .main-navigation ul > li:hover > a,
  275. .main-navigation ul ul > li:hover > a,
  276. .menu-toggle,
  277. .menu-toggle:focus,
  278. .dropdown-toggle.toggled-on:after,
  279. .dropdown-toggle:hover::after,
  280. .dropdown-toggle:active,
  281. .dropdown-toggle:focus,
  282. .entry-content a,
  283. .entry-meta a:active,
  284. .entry-meta a:hover,
  285. .entry-title a:active,
  286. .entry-title a:hover,
  287. .bypostauthor .fn:before,
  288. .comment .comment-author a,
  289. .comment-content a,
  290. .comment .comment-reply-link,
  291. .comment .comment-reply-title a,
  292. #infinite-handle span button,
  293. .posts-navigation a,
  294. .widget_calendar table a,
  295. .widget_tag_cloud a[style],
  296. .wpcom-reblog-snapshot .reblog-post:before', 'color', 'bg' ),
  297. ),
  298. __( 'Links, Headings, and Buttons' ) );
  299. /**
  300. * Featured Color Schemes
  301. */
  302. add_color_palette( array(
  303. '#F9F4F0',
  304. '#ed0202',
  305. '#1e120f',
  306. '',
  307. '',
  308. ), __( 'Tan, Red, & Mahogany' ) );
  309. add_color_palette( array(
  310. '#2a044a',
  311. '#f0c060',
  312. '#f35029',
  313. '',
  314. '',
  315. ), __( 'Mardi Gras' ) );
  316. add_color_palette( array(
  317. '#f9f7f0',
  318. '#666666',
  319. '#198975',
  320. '',
  321. '',
  322. ), __( 'Off White & Ever Green' ) );
  323. add_color_palette( array(
  324. '#000000',
  325. '#ededed',
  326. '#c60000',
  327. '',
  328. '',
  329. ), __( 'Black, Gray, & Red' ) );
  330. add_color_palette( array(
  331. '#228a24',
  332. '#ffffff',
  333. '#000000',
  334. '',
  335. '',
  336. ), __( 'Green, White & Black' ) );
  337. add_color_palette( array(
  338. '#ffffff',
  339. '#b38184',
  340. '#455c86',
  341. '',
  342. '',
  343. ), __( 'White, Mauve & Navy' ) );