wpcom-colors.php 13 KB

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