wpcom-colors.php 14 KB

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