wpcom-colors.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <?php
  2. /* Custom Colors: Maywood */
  3. // Background Color
  4. // $config-global--color-background-default
  5. add_color_rule( 'bg', '#FFFFFF', array(
  6. // Background-color
  7. array( '.screen-reader-text:focus,
  8. body,
  9. body .widget_eu_cookie_law_widget #eu-cookie-law,
  10. body .widget_eu_cookie_law_widget #eu-cookie-law.negative input.accept,
  11. .main-navigation > div > ul > li > .sub-menu', 'background-color' ),
  12. // Text-color
  13. array( '.a8c-posts-list-item__featured span,
  14. .wp-block-cover.has-background-dim,
  15. .wp-block-cover-image.has-background-dim,
  16. .sticky-post,
  17. .wp-block-pullquote.is-style-solid-color,
  18. body .widget_eu_cookie_law_widget #eu-cookie-law.negative', 'color' ),
  19. // Text-color darkened
  20. array( 'hr.wp-block-separator.is-style-dots:before', 'color', '-1' ),
  21. // Background-color darkened
  22. array( '.wp-block-table.is-style-stripes tbody tr:nth-child(odd),
  23. table.is-style-stripes tbody tr:nth-child(odd)', 'background-color', '-1' ),
  24. // Background-color darkened
  25. array( 'body .widget_eu_cookie_law_widget #eu-cookie-law.negative input.accept.has-focus,
  26. body .widget_eu_cookie_law_widget #eu-cookie-law.negative input.accept:focus,
  27. body .widget_eu_cookie_law_widget #eu-cookie-law.negative input.accept:hover', 'background-color', '-1' ),
  28. // Border-color darkened
  29. array( '.wp-block-code,
  30. body .widget_eu_cookie_law_widget #eu-cookie-law,
  31. input[type="color"],
  32. input[type="date"],
  33. input[type="datetime"],
  34. input[type="datetime-local"],
  35. input[type="email"],
  36. input[type="month"],
  37. input[type="number"],
  38. input[type="password"],
  39. input[type="range"],
  40. input[type="search"],
  41. input[type="tel"],
  42. input[type="text"],
  43. input[type="time"],
  44. input[type="url"],
  45. input[type="week"],
  46. select,
  47. textarea,
  48. .site-header > .main-navigation > div > ul > li > .sub-menu', 'border-color', '-1' ),
  49. // Border-top-color darkened
  50. array( '.comment-list .children > li,
  51. .comment-list > li,
  52. .wp-block-pullquote', 'border-top-color', '-1' ),
  53. // Border-bottom-color darkened
  54. array( '.comment-list,
  55. .wp-block-pullquote,
  56. hr,
  57. hr.wp-block-separator', 'border-bottom-color', '-1' ),
  58. /**
  59. * Utility Classes
  60. */
  61. // Text-color
  62. array( '.has-primary-background-color[class],
  63. .has-primary-background-color.has-background-dim[class],
  64. .has-secondary-background-color[class],
  65. .has-secondary-background-color.has-background-dim[class],
  66. .has-foreground-background-color[class],
  67. .has-foreground-background-color.has-background-dim[class],
  68. .has-foreground-dark-background-color[class],
  69. .has-foreground-dark-background-color.has-background-dim[class],
  70. .has-foreground-light-background-color[class],
  71. .has-foreground-light-background-color.has-background-dim[class],
  72. .has-background-color[class],
  73. .has-background-dark-color[class],
  74. .has-background-light-color[class]', 'color' ),
  75. // Background-color
  76. array( '.has-background-background-color[class],
  77. .has-background-background-color.has-background-dim[class]', 'background-color' ),
  78. // Text-color darkened
  79. array( '.has-background-dark-color[class]', 'color', '-1' ),
  80. // Background-color darkened
  81. array( '.has-background-dark-background-color[class],
  82. .has-foreground-dark-background-color.has-background-dim[class]', 'background-color', '-1' ),
  83. // Text-color lightened
  84. array( '.has-background-light-color[class]', 'color', '+1' ),
  85. // Background-color lightened
  86. array( '.has-background-light-background-color[class],
  87. .has-foreground-light-background-color.has-background-dim[class]', 'background-color', '+1' ),
  88. ), __( 'Background Color' ) );
  89. // Link Color
  90. // $config-global--color-primary-default
  91. add_color_rule( 'link', '#897248', array(
  92. // Text-color
  93. array( '.a8c-posts-list .a8c-posts-list-item__title a:active,
  94. .a8c-posts-list .a8c-posts-list-item__title a:focus,
  95. .a8c-posts-list .a8c-posts-list-item__title a:hover,
  96. .entry-title a:active,
  97. .entry-title a:focus,
  98. .entry-title a:hover,
  99. .main-navigation li a:hover,
  100. .main-navigation li:hover > a,
  101. .main-navigation a:hover,
  102. .page-title a:active,
  103. .page-title a:focus,
  104. .page-title a:hover,
  105. .site-title a:hover,
  106. .social-navigation a:hover,
  107. .wp-block-button.is-style-outline .wp-block-button__link:active,
  108. .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color),
  109. .wp-block-button.is-style-outline.wp-block-button__link:active,
  110. .wp-block-button.is-style-outline.wp-block-button__link:not(.has-text-color),
  111. .wp-block-newspack-blocks-homepage-articles article .entry-title a,
  112. .wp-block-newspack-blocks-homepage-articles article .entry-title a:active,
  113. .wp-block-newspack-blocks-homepage-articles article .entry-title a:focus,
  114. .wp-block-newspack-blocks-homepage-articles article .entry-title a:hover,
  115. a', 'color'),
  116. // Background-color
  117. array( '.a8c-posts-list-item__featured span,
  118. .a8c-posts-list__view-all,
  119. .button,
  120. .main-navigation #toggle:focus + #toggle-menu,
  121. .sticky-post,
  122. .wp-block-button__link,
  123. .wp-block-file .wp-block-file__button,
  124. .wp-block-file__button,
  125. .wp-block-pullquote.is-style-solid-color,
  126. body .widget_eu_cookie_law_widget #eu-cookie-law input.accept,
  127. button,
  128. button[data-load-more-btn],
  129. input[type="submit"]', 'background-color' ),
  130. // Border color left
  131. array( '.wp-block-quote', 'border-left-color' ),
  132. // Border color right
  133. array( '.wp-block-quote[style*="text-align: right"],
  134. .wp-block-quote[style*="text-align:right"]', 'border-right-color' ),
  135. // Text-color darkened
  136. array( '.a8c-posts-list__item .a8c-posts-list-item__meta a:active,
  137. .a8c-posts-list__item .a8c-posts-list-item__meta a:hover,
  138. .comment-meta .comment-metadata a:active,
  139. .comment-meta .comment-metadata a:hover,
  140. .entry-footer a:active,
  141. .entry-footer a:hover,
  142. .entry-meta a:active,
  143. .entry-meta a:hover,
  144. .footer-navigation .footer-menu a:hover,
  145. .site-info a:hover,
  146. .wp-block-button.is-style-outline .wp-block-button__link.has-focus,
  147. .wp-block-button.is-style-outline .wp-block-button__link:focus,
  148. .wp-block-button.is-style-outline .wp-block-button__link:hover,
  149. .wp-block-button.is-style-outline.wp-block-button__link.has-focus,
  150. .wp-block-button.is-style-outline.wp-block-button__link:focus,
  151. .wp-block-button.is-style-outline.wp-block-button__link:hover,
  152. .wp-block-newspack-blocks-homepage-articles article .cat-links a:active,
  153. .wp-block-newspack-blocks-homepage-articles article .cat-links a:hover,
  154. .wp-block-newspack-blocks-homepage-articles article .entry-meta a:active,
  155. .wp-block-newspack-blocks-homepage-articles article .entry-meta a:hover,
  156. .wp-block-newspack-blocks-homepage-articles article .entry-title a:hover,
  157. .wp-block-newspack-blocks-homepage-articles article .more-link:hover,
  158. a:hover', 'color', '-1' ),
  159. // Background-color darkened
  160. array( '.a8c-posts-list__view-all:focus,
  161. .a8c-posts-list__view-all:hover,
  162. .button:focus,
  163. .button:hover,
  164. .has-focus.a8c-posts-list__view-all,
  165. .has-focus.button,
  166. .has-focus.wp-block-button__link,
  167. .has-focus.wp-block-file__button,
  168. .wp-block-button__link:focus,
  169. .wp-block-button__link:hover,
  170. .wp-block-file__button:focus,
  171. .wp-block-file__button:hover,
  172. body .widget_eu_cookie_law_widget #eu-cookie-law input.accept:focus,
  173. body .widget_eu_cookie_law_widget #eu-cookie-law input.accept:hover,
  174. body .widget_eu_cookie_law_widget #eu-cookie-law input.has-focus.accept,
  175. button.has-focus,
  176. button:focus,
  177. button:hover,
  178. input.has-focus[type="submit"],
  179. input:focus[type="submit"],
  180. input:hover[type="submit"]', 'background-color', '-1' ),
  181. // Background-color darkened
  182. array( 'input[type="color"]:focus,
  183. input[type="date"]:focus,
  184. input[type="datetime"]:focus,
  185. input[type="datetime-local"]:focus,
  186. input[type="email"]:focus,
  187. input[type="month"]:focus,
  188. input[type="number"]:focus,
  189. input[type="password"]:focus,
  190. input[type="range"]:focus,
  191. input[type="search"]:focus,
  192. input[type="tel"]:focus,
  193. input[type="text"]:focus,
  194. input[type="time"]:focus,
  195. input[type="url"]:focus,
  196. input[type="week"]:focus,
  197. textarea:focus', 'border-color', '-1' ),
  198. /**
  199. * Utility Classes
  200. */
  201. // Text-color
  202. array( '.has-primary-color[class]', 'color' ),
  203. // Background-color
  204. array( '.has-primary-background-color[class],
  205. .has-primary-background-color.has-background-dim[class]', 'background-color' ),
  206. ), __( 'Link Color' ) );
  207. // Text Color
  208. // $config-global--color-foreground-default
  209. add_color_rule( 'txt', '#181818', array(
  210. // Text-color
  211. array( '.comment-meta .comment-metadata,
  212. .main-navigation,
  213. .main-navigation a,
  214. .main-navigation a:link,
  215. .main-navigation a:visited,
  216. .screen-reader-text:focus,
  217. .site-title,
  218. .social-navigation a,
  219. .wp-block-code,
  220. .wp-block-code pre,
  221. .wp-block-pullquote,
  222. .wp-block-table.is-style-stripes tbody tr:nth-child(odd),
  223. table.is-style-stripes tbody tr:nth-child(odd),
  224. body,
  225. body .widget_eu_cookie_law_widget #eu-cookie-law,
  226. body .widget_eu_cookie_law_widget #eu-cookie-law.negative input.accept', 'color' ),
  227. // Background-color
  228. array( 'body .widget_eu_cookie_law_widget #eu-cookie-law.negative', 'background-color' ),
  229. /**
  230. * Utility Classes
  231. */
  232. // Foreground
  233. array( '.has-foreground-color[class],
  234. .has-background-background-color[class],
  235. .has-background-background-color.has-background-dim[class],
  236. .has-background-dark-background-color[class],
  237. .has-background-dark-background-color.has-background-dim[class],
  238. .has-background-light-background-color[class],
  239. .has-background-light-background-color.has-background-dim[class]', 'color' ),
  240. // Background-color
  241. array( '.has-background-dim[class],
  242. .has-foreground-background-color[class],
  243. .has-foreground-background-color.has-background-dim[class]', 'background-color' ),
  244. // Text-color darkened
  245. array( '.has-foreground-dark-color[class]', 'color', '-1' ),
  246. // Background-color darkened
  247. array( '.has-foreground-dark-background-color[class],
  248. .has-foreground-dark-background-color.has-background-dim[class]', 'background-color', '-1' ),
  249. // Text-color brightened
  250. array( '.has-foreground-light-color[class]', 'color', '+2' ),
  251. // Background-color brightened
  252. array( '.has-foreground-light-background-color[class],
  253. .has-foreground-light-background-color.has-background-dim[class]', 'background-color', '+2' ),
  254. /**
  255. * Gray (Same as text color)
  256. */
  257. // Text-color
  258. array( '.a8c-posts-list__item .a8c-posts-list-item__meta,
  259. .comment-notes,
  260. .entry-footer,
  261. .entry-meta,
  262. .footer-navigation .footer-menu,
  263. .post-navigation .meta-nav,
  264. .site-branding,
  265. .site-info,
  266. .widget_archive ul li,
  267. .widget_categories ul li,
  268. .widget_meta ul li,
  269. .widget_nav_menu ul li,
  270. .widget_pages ul li,
  271. .widget_recent_comments ul li,
  272. .widget_recent_entries ul li,
  273. .widget_rss ul li,
  274. .wp-block-image figcaption,
  275. .wp-block-latest-comments .wp-block-latest-comments__comment-date,
  276. .wp-block-latest-posts .wp-block-latest-posts__post-date,
  277. .wp-block-newspack-blocks-homepage-articles article .cat-links,
  278. .wp-block-newspack-blocks-homepage-articles article .entry-meta,
  279. .wp-block-pullquote .wp-block-pullquote__citation,
  280. .wp-block-pullquote cite,
  281. .wp-block-pullquote footer,
  282. .wp-block-quote .wp-block-quote__citation,
  283. .wp-block-quote cite,
  284. .wp-block-quote footer,
  285. .wp-block-quote.is-large .wp-block-quote__citation,
  286. .wp-block-quote.is-large cite,
  287. .wp-block-quote.is-large footer,
  288. .wp-block-quote.is-style-large .wp-block-quote__citation,
  289. .wp-block-quote.is-style-large cite,
  290. .wp-block-quote.is-style-large footer,
  291. .wp-block-video figcaption,
  292. figcaption', 'color' ),
  293. ), __( 'Text Color' ) );
  294. // Accent Color
  295. // $config-global--color-secondary-default
  296. add_color_rule( 'fg1', '#c4493f', array(
  297. /**
  298. * Utility Classes
  299. */
  300. // Text-color
  301. array( '.has-secondary-color[class]', 'color' ),
  302. // Background-color
  303. array( '.has-secondary-background-color[class],
  304. .has-secondary-background-color.has-background-dim[class]', 'background-color' ),
  305. ), __( 'Secondary Color' ) );
  306. /**
  307. * Custom CSS
  308. */
  309. function maywood_custom_colors_extra_css() {
  310. $colors_array = get_theme_mod( 'colors_manager' );
  311. $txt = $colors_array['colors']['txt'];
  312. ?>
  313. .wp-block-cover[style*="background-image"] h1,
  314. .wp-block-cover[style*="background-image"] h2,
  315. .wp-block-cover[style*="background-image"] h3,
  316. .wp-block-cover[style*="background-image"] h4,
  317. .wp-block-cover[style*="background-image"] h5,
  318. .wp-block-cover[style*="background-image"] h6,
  319. .wp-block-cover video + .wp-block-cover__inner-container h1,
  320. .wp-block-cover video + .wp-block-cover__inner-container h2,
  321. .wp-block-cover video + .wp-block-cover__inner-container h3,
  322. .wp-block-cover video + .wp-block-cover__inner-container h4,
  323. .wp-block-cover video + .wp-block-cover__inner-container h5,
  324. .wp-block-cover video + .wp-block-cover__inner-container h6,
  325. .wp-block-cover-image[style*="background-image"] h1,
  326. .wp-block-cover-image[style*="background-image"] h2,
  327. .wp-block-cover-image[style*="background-image"] h3,
  328. .wp-block-cover-image[style*="background-image"] h4,
  329. .wp-block-cover-image[style*="background-image"] h5,
  330. .wp-block-cover-image[style*="background-image"] h6,
  331. .wp-block-cover-image video + .wp-block-cover__inner-container h1,
  332. .wp-block-cover-image video + .wp-block-cover__inner-container h2,
  333. .wp-block-cover-image video + .wp-block-cover__inner-container h3,
  334. .wp-block-cover-image video + .wp-block-cover__inner-container h4,
  335. .wp-block-cover-image video + .wp-block-cover__inner-container h5,
  336. .wp-block-cover-image video + .wp-block-cover__inner-container h6 {
  337. text-shadow: none;
  338. }
  339. .wp-block-cover[style*="background-image"] p,
  340. .wp-block-cover video + .wp-block-cover__inner-container p,
  341. .wp-block-cover-image[style*="background-image"] p,
  342. .wp-block-cover-image video + .wp-block-cover__inner-container p {
  343. text-shadow: none;
  344. }
  345. <?php }
  346. add_theme_support( 'custom_colors_extra_css', 'maywood_custom_colors_extra_css' );
  347. /**
  348. * Featured Varia Palettes
  349. */
  350. // Light
  351. add_color_palette( array(
  352. '#FFFFFF',
  353. '#1D1E1E',
  354. '#C8133E',
  355. '#4E2F4B',
  356. ), 'Light' );
  357. // Medium
  358. add_color_palette( array(
  359. '#EEF4F7',
  360. '#242527',
  361. '#35845D',
  362. '#233252',
  363. ), 'Medium' );
  364. // Dark
  365. add_color_palette( array(
  366. '#1F2527',
  367. '#FFFFFF',
  368. '#9FD3E8',
  369. '#FBE6AA',
  370. ), 'Dark' );