wpcom-colors.php 13 KB

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