wpcom-colors.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <?php
  2. /* Custom Colors: Independent Publisher */
  3. add_color_rule( 'bg', '#ffffff', array(
  4. // No contrast
  5. array( 'body', 'background-color' ),
  6. array( '#infinite-footer .container', 'background-color', 0.7 ),
  7. array( '.post-edit-link a', 'background-color', '-0.2' ),
  8. ) );
  9. add_color_rule( 'txt', '#333332', array(
  10. array( '.entry-author .author-title,
  11. .entry-title,
  12. .entry-title a,
  13. .entry-title a:visited,
  14. .site-posted-on strong,
  15. .site-title,
  16. .site-title a,
  17. .site-title a:visited,
  18. .entry-title a:hover,
  19. .site-title a:hover,
  20. h1,
  21. h2,
  22. h3,
  23. h4,
  24. h5,
  25. h6,
  26. .page-header:not(.page-header-light) h1,
  27. .comment .comment-meta .comment-author .fn', 'color', 'bg' ),
  28. ), __( 'Headings' ) );
  29. add_color_rule( 'link', '#0087be', array(
  30. array( '.comment-form input[type="email"]:active,
  31. .comment-form input[type="email"]:focus,
  32. .comment-form input[type="password"]:active,
  33. .comment-form input[type="password"]:focus,
  34. .comment-form input[type="search"]:active,
  35. .comment-form input[type="search"]:focus,
  36. .comment-form input[type="text"]:active,
  37. .comment-form input[type="text"]:focus,
  38. .comment-form input[type="url"]:active,
  39. .comment-form input[type="url"]:focus,
  40. .comment-form textarea:active,
  41. .comment-form textarea:focus,
  42. blockquote,
  43. input[type="email"]:focus,
  44. input[type="password"]:focus,
  45. input[type="search"]:focus,
  46. input[type="text"]:focus,
  47. input[type="url"]:focus,
  48. textarea:focus', 'border-color' ),
  49. array( '.comment .comment-meta .comment-metadata a:hover,
  50. .comment-form span.required,
  51. .pingback:before,
  52. .post-details a:hover,
  53. .post-edit-link a:active,
  54. .post-edit-link a:focus,
  55. .post-edit-link a:hover,
  56. .site-info a:hover,
  57. .trackback:before,
  58. a,
  59. a:visited', 'color', 'bg' ),
  60. array( '.main-navigation > div > ul > li.current-menu-item > a,
  61. .main-navigation > div > ul > li.current_page_item > a,
  62. a:active,
  63. a:focus,
  64. a:hover,
  65. .page-links a:hover', 'color', 'bg', 2 ),
  66. array( '.posts-navigation .nav-links a,
  67. .main-navigation ul ul', 'background-color' ),
  68. ),
  69. __( 'Links' ) );
  70. add_color_rule( 'fg1', '#0087be', array(
  71. array( 'button,
  72. input[type="button"],
  73. input[type="reset"],
  74. input[type="submit"],
  75. .button,
  76. #content #infinite-handle span button,
  77. .more-link', 'background-color' ),
  78. //:not(".components-button") avoids targeting button styles in the Gutenberg editor
  79. array( 'button:not(".components-button"):hover,
  80. input[type="button"]:hover,
  81. input[type="reset"]:hover,
  82. input[type="submit"]:hover,
  83. .button:hover,
  84. #content #infinite-handle span button:hover,
  85. .more-link:hover', 'background-color', '-1' ),
  86. ),
  87. __( 'Buttons' ) );
  88. add_color_rule( 'extra', '#383838', array(
  89. array( '.widget_recent_comments a,
  90. .widget_recent_entries a,
  91. body,
  92. input,
  93. select,
  94. textarea,
  95. .menu-toggle', 'color', 'bg' ),
  96. array( '#infinite-footer .blog-info a:hover,
  97. #infinite-footer .blog-credits a:hover', 'color', 'bg' ),
  98. ) );
  99. add_color_rule( 'extra', '#ffffff', array(
  100. array( '.posts-navigation .nav-links a,
  101. .main-navigation ul ul a,
  102. .main-navigation > div > ul > li.current-menu-item > ul > li a,
  103. .main-navigation > div > ul > li.current_page_item > ul > li a', 'color', 'link' ),
  104. array( 'input[type="button"],
  105. input[type="button"]:hover,
  106. input[type="reset"],
  107. input[type="reset"]:hover,
  108. input[type="submit"],
  109. input[type="submit"]:hover,
  110. button,
  111. .button,
  112. .button:hover,
  113. #content #infinite-handle span button,
  114. #content #infinite-handle span button:hover,
  115. .more-link,
  116. .more-link:hover,
  117. .more-link:visited', 'color', 'fg1' ),
  118. ) );
  119. add_color_rule( 'extra', '#dddddd', array(
  120. array( '.site-main > .hentry:nth-child(n+2), .site .infinite-wrap > .hentry:nth-child(n+2),
  121. .entry-author-wrapper,
  122. .post-navigation,
  123. .comment,
  124. .page-links a:hover,
  125. .main-navigation li', 'border-color', 0.25 ),
  126. array( '#infinite-footer .blog-info a,
  127. #infinite-footer .blog-credits,
  128. #infinite-footer .blog-credits a', 'color', 'bg' ),
  129. ) );
  130. add_color_rule( 'extra', '#92928f', array(
  131. array( '.post-details,
  132. .post-details a,
  133. .post-details a:visited,
  134. .post-edit-link a,
  135. .post-edit-link a:visited', 'color', 'bg' ),
  136. ) );
  137. add_color_rule( 'extra', '#515151', array(
  138. array( '.post-tags li:first-child,
  139. .jetpack-social-navigation li a:hover,
  140. .widget_wpcom_social_media_icons_widget li a:hover,
  141. .jetpack-social-navigation li a:focus,
  142. .widget_wpcom_social_media_icons_widget li a:focus,
  143. .jetpack-social-navigation li a:active,
  144. .widget_wpcom_social_media_icons_widget li a:active', 'color', 'bg' ),
  145. ) );
  146. add_color_rule( 'extra', '#a4a4a4', array(
  147. array( '.jetpack-social-navigation li a,
  148. .widget_wpcom_social_media_icons_widget li a', 'color', 'bg' ),
  149. ) );
  150. add_color_rule( 'extra', '#929292', array(
  151. array( '.post-navigation .nav-links a:hover,
  152. .post-navigation .nav-links a:focus,
  153. .post-navigation .nav-links a:active,
  154. .entry-author .author-bio,
  155. .site-posted-on time,
  156. .site-description', 'color', 'bg' ),
  157. ) );
  158. add_color_rule( 'extra', '#b3b3b1', array(
  159. array( '.comment .comment-meta,
  160. .comment-form label,
  161. .light-text,
  162. .light-text a,
  163. .light-text a:visited,
  164. .widget_rss .rss-date,
  165. .widget_rss li > cite', 'color', 'bg' ),
  166. ) );
  167. add_color_rule( 'extra', '#747471', array(
  168. array( '.light-text a:hover', 'color', 'bg' ),
  169. ) );
  170. function independent_publisher_extra_css() { ?>
  171. .has-header-image .site-title a,
  172. .has-header-image .site-title a:visited {
  173. color: #fff;
  174. }
  175. @media screen and ( max-width: 32.374em ) {
  176. .main-navigation ul ul {
  177. background: transparent !important;
  178. }
  179. .main-navigation ul ul a {
  180. color: inherit !important;
  181. }
  182. }
  183. <?php }
  184. add_theme_support( 'custom_colors_extra_css', 'independent_publisher_extra_css' );
  185. add_color_palette( array(
  186. '#2d3238',
  187. '#383838',
  188. '#f5f5f3',
  189. '#f5f5f3'
  190. ) );
  191. add_color_palette( array(
  192. '#413e4a',
  193. '#73626e',
  194. '#b38184',
  195. '#ffffff',
  196. ) );
  197. add_color_palette( array(
  198. '#435464',
  199. '#798585',
  200. '#bcde72',
  201. '#d5e3fa',
  202. ) );
  203. add_color_palette( array(
  204. '#f9f9f9',
  205. '#306363',
  206. '#3ca2a2',
  207. '#a5d8d8',
  208. ) );
  209. add_color_palette( array(
  210. '#f6f6f6',
  211. '#333333',
  212. '#cc1919',
  213. '#cc1919',
  214. ) );
  215. add_color_palette( array(
  216. '#ebedef',
  217. '#525e6a',
  218. '#90a1b5',
  219. '#c86e64',
  220. ) );