wpcom-colors.php 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <?php
  2. /* Custom Colors: Karuna */
  3. //Background
  4. add_color_rule( 'bg', '#ffffff', array(
  5. array( 'body, .sticky-wrapper, .site-info', 'background-color' ),
  6. ) );
  7. //Purple
  8. add_color_rule( 'txt', '#6636cc', array(
  9. //No contrast
  10. array( '.main-navigation ul ul,
  11. .footer-widgets-wrapper,
  12. .site-footer,
  13. .top-bar', 'background-color' ),
  14. //Contrast against background bg
  15. array( '#infinite-handle span,
  16. .button,
  17. button,
  18. input[type="button"],
  19. input[type="color"]:focus,
  20. input[type="date"]:focus,
  21. input[type="datetime"]:focus,
  22. input[type="datetime-local"]:focus,
  23. input[type="email"]:focus,
  24. input[type="month"]:focus,
  25. input[type="number"]:focus,
  26. input[type="password"]:focus,
  27. input[type="range"]:focus,
  28. input[type="reset"],
  29. input[type="search"]:focus,
  30. input[type="submit"],
  31. input[type="tel"]:focus,
  32. input[type="text"]:focus,
  33. input[type="time"]:focus,
  34. input[type="url"]:focus,
  35. input[type="week"]:focus,
  36. textarea:focus,
  37. .jetpack-recipe-title', 'border-color', 'bg' ),
  38. array( '#infinite-handle span,
  39. .button,
  40. .comment-navigation a,
  41. .comment-navigation a:visited,
  42. .post-navigation a,
  43. .post-navigation a:visited,
  44. .posts-navigation a,
  45. .posts-navigation a:visited,
  46. a,
  47. a:visited,
  48. button,
  49. input[type="button"],
  50. input[type="reset"],
  51. input[type="submit"]', 'color', 'bg' ),
  52. ),
  53. __( 'Links' ) );
  54. //Green
  55. add_color_rule( 'link', '#85cc36', array(
  56. //Contrast with background bg
  57. array( '.header-widget-area', 'background-color' ),
  58. array( '#infinite-handle span:active,
  59. #infinite-handle span:focus,
  60. #infinite-handle span:hover,
  61. .button:active,
  62. .button:focus,
  63. .button:hover,
  64. button:active,
  65. button:focus,
  66. button:hover,
  67. input[type="button"]:active,
  68. input[type="button"]:focus,
  69. input[type="button"]:hover,
  70. input[type="reset"]:active,
  71. input[type="reset"]:focus,
  72. input[type="reset"]:hover,
  73. input[type="submit"]:active,
  74. input[type="submit"]:focus,
  75. input[type="submit"]:hover', 'border-color', 'bg' ),
  76. array( '#infinite-handle span:active,
  77. #infinite-handle span:focus,
  78. #infinite-handle span:hover,
  79. .button:active,
  80. .button:focus,
  81. .button:hover,
  82. .comment-navigation a:hover,
  83. .comment-navigation a:visited:hover,
  84. .entry-title a:focus,
  85. .entry-title a:hover,
  86. .post-navigation a:hover,
  87. .post-navigation a:visited:hover,
  88. .posts-navigation a:hover,
  89. .posts-navigation a:visited:hover,
  90. a:active,
  91. a:focus,
  92. a:hover,
  93. button:active,
  94. button:focus,
  95. button:hover,
  96. input[type="button"]:active,
  97. input[type="button"]:focus,
  98. input[type="button"]:hover,
  99. input[type="reset"]:active,
  100. input[type="reset"]:focus,
  101. input[type="reset"]:hover,
  102. input[type="submit"]:active,
  103. input[type="submit"]:focus,
  104. input[type="submit"]:hover', 'color', 'bg' ),
  105. ),
  106. __( 'Secondary Accent' ) );
  107. add_color_rule( 'fg1', '#333333', array(
  108. array( 'h1, h2, h3, h4, h5, h6,
  109. .site-title a,
  110. .site-title a:visited,
  111. .entry-title,
  112. .page-title,
  113. .entry-title a,
  114. .entry-title a:visited,
  115. .widget-title,
  116. .widget-title a,
  117. .widget-title a:visited', 'color', 'bg' ),
  118. ),
  119. __( 'Headings' ) );
  120. add_color_rule( 'fg2', '#ffffff', array(
  121. ) );
  122. //Extra rules
  123. add_color_rule( 'extra', '#ffffff', array(
  124. //Contrast with green link
  125. array( '.header-widget-area,
  126. .header-widget-area #infinite-handle span,
  127. .header-widget-area .button,
  128. .header-widget-area a,
  129. .header-widget-area a:visited,
  130. .header-widget-area a:hover,
  131. .header-widget-area a:focus,
  132. .header-widget-area button,
  133. .header-widget-area input[type="button"],
  134. .header-widget-area input[type="reset"],
  135. .header-widget-area input[type="submit"]', 'color', 'link', 2 ),
  136. array( '.header-widget-area .button,
  137. .header-widget-area button,
  138. .header-widget-area input[type="button"],
  139. .header-widget-area input[type="reset"],
  140. .header-widget-area input[type="submit"]', 'border-color', 'link', 2 ),
  141. array( '.header-widget-area .widget-title,
  142. .header-widget-area .widget-title a,
  143. .header-widget-area .widget-title a:visited', 'color', 'link', 2 ),
  144. //Contrast with purple txt
  145. array( '.main-navigation ul ul a,
  146. .main-navigation ul ul a:focus,
  147. .main-navigation ul ul a:hover,
  148. .main-navigation ul ul a:visited,
  149. .main-navigation ul ul a:visited:focus,
  150. .main-navigation ul ul a:visited:hover,
  151. .footer-widgets-wrapper,
  152. .footer-widgets-wrapper a,
  153. .footer-widgets-wrapper a:visited,
  154. .footer-widgets-wrapper a:hover,
  155. .footer-widgets-wrapper a:focus,
  156. .footer-widgets-wrapper button,
  157. .footer-widgets-wrapper button:hover,
  158. .footer-widgets-wrapper button:focus,
  159. .footer-widgets-wrapper input[type="button"],
  160. .footer-widgets-wrapper input[type="button"]:hover,
  161. .footer-widgets-wrapper input[type="button"]:focus,
  162. .footer-widgets-wrapper input[type="reset"],
  163. .footer-widgets-wrapper input[type="reset"]:hover,
  164. .footer-widgets-wrapper input[type="reset"]:focus,
  165. .footer-widgets-wrapper input[type="submit"],
  166. .footer-widgets-wrapper input[type="submit"]:hover,
  167. .footer-widgets-wrapper input[type="submit"]:focus,
  168. .footer-widgets-wrapper .button,
  169. .footer-widgets-wrapper .button:hover,
  170. .footer-widgets-wrapper .button:focus,
  171. .site-footer,
  172. .top-bar,
  173. .top-bar a,
  174. .top-bar a:visited,
  175. .top-bar a:hover,
  176. .top-bar a:focus', 'color', 'txt', 2 ),
  177. array( '.footer-widgets-wrapper .widget-title,
  178. .footer-widgets-wrapper .widget-title a,
  179. .footer-widgets-wrapper .widget-title a:visited,
  180. .footer-widgets-wrapper .widget-title a:hover,
  181. .footer-widgets-wrapper .widget-title a:focus', 'color', 'txt', 2 ),
  182. array( '.footer-widgets-wrapper button,
  183. .footer-widgets-wrapper button:hover,
  184. .footer-widgets-wrapper button:focus,
  185. .footer-widgets-wrapper input[type="button"],
  186. .footer-widgets-wrapper input[type="button"]:hover,
  187. .footer-widgets-wrapper input[type="button"]:focus,
  188. .footer-widgets-wrapper input[type="reset"],
  189. .footer-widgets-wrapper input[type="reset"]:hover,
  190. .footer-widgets-wrapper input[type="reset"]:focus,
  191. .footer-widgets-wrapper input[type="submit"],
  192. .footer-widgets-wrapper input[type="submit"]:hover,
  193. .footer-widgets-wrapper input[type="submit"]:focus,
  194. .footer-widgets-wrapper .button,
  195. .footer-widgets-wrapper .button:hover,
  196. .footer-widgets-wrapper .button:focus', 'border-color', 'txt', 2 ),
  197. ) );
  198. add_color_rule( 'extra', '#333333', array(
  199. array( 'body,
  200. .main-navigation a,
  201. .main-navigation a:visited,
  202. .main-navigation a:hover,
  203. .main-navigation a:focus,
  204. .main-navigation a:visited:hover,
  205. .main-navigation a:visited:focus,
  206. .main-navigation .current_page_item > a,
  207. .main-navigation .current-menu-item > a,
  208. .main-navigation .current_page_ancestor > a,
  209. .main-navigation .current-menu-ancestor > a', 'color', 'bg' ),
  210. ) );
  211. add_color_rule( 'extra', '#999999', array(
  212. array( '.entry-meta,
  213. .entry-footer,
  214. .entry-meta a,
  215. .entry-footer a,
  216. .entry-meta a:visited,
  217. .entry-footer a:visited,
  218. .entry-author .author-title', 'color', 'bg' ),
  219. ) );
  220. add_color_rule( 'extra', '#dddddd', array(
  221. array( '.comment-navigation,
  222. .posts-navigation,
  223. .post-navigation', 'border-color', 0.25 ),
  224. ) );
  225. //Extra CSS
  226. function karuna_extra_css() { ?>
  227. @media screen and ( max-width: 767px ) {
  228. .main-navigation ul ul {
  229. background-color: transparent !important;
  230. }
  231. .main-navigation ul ul a {
  232. color: inherit !important;
  233. }
  234. }
  235. <?php }
  236. add_theme_support( 'custom_colors_extra_css', 'karuna_extra_css' );
  237. //Additional palettes
  238. add_color_palette( array(
  239. '#f6f4ee',
  240. '#524656',
  241. '#cf4647',
  242. '#333333',
  243. ), 'Vintage' );
  244. add_color_palette( array(
  245. '#444444',
  246. '#005f6b',
  247. '#005f6b',
  248. '#ffffff',
  249. ), 'Dark Blue' );
  250. add_color_palette( array(
  251. '#ffffff',
  252. '#bc2929',
  253. '#565e71',
  254. '#565e71',
  255. ), 'Vintage 2' );
  256. add_color_palette( array(
  257. '#ffffff',
  258. '#f38148',
  259. '#038d9f',
  260. '#222222',
  261. ), 'Orange' );
  262. add_color_palette( array(
  263. '#f8f6f6',
  264. '#f76868',
  265. '#78c3a1',
  266. '#666666',
  267. ), 'Pink Mint' );
  268. add_color_palette( array(
  269. '#555555',
  270. '#333333',
  271. '#333333',
  272. '#ffffff',
  273. ), 'Dark Gray' );