wpcom-colors.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  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. input[type="color"],
  191. input[type="color"]:focus,
  192. input[type="date"],
  193. input[type="date"]:focus,
  194. input[type="datetime"],
  195. input[type="datetime"]:focus,
  196. input[type="datetime-local"],
  197. input[type="datetime-local"]:focus,
  198. input[type="email"],
  199. input[type="email"]:focus,
  200. input[type="month"],
  201. input[type="month"]:focus,
  202. input[type="number"],
  203. input[type="number"]:focus,
  204. input[type="password"],
  205. input[type="password"]:focus,
  206. input[type="range"],
  207. input[type="range"]:focus,
  208. input[type="search"],
  209. input[type="search"]:focus,
  210. input[type="tel"],
  211. input[type="tel"]:focus,
  212. input[type="text"],
  213. input[type="text"]:focus,
  214. input[type="time"],
  215. input[type="time"]:focus,
  216. input[type="url"],
  217. input[type="url"]:focus,
  218. input[type="week"],
  219. input[type="week"]:focus,
  220. textarea,
  221. textarea:focus,
  222. .site-header .main-navigation > div > ul > li .sub-menu a,
  223. .a8c-posts-list__item .a8c-posts-list-item__meta,
  224. .entry-footer,
  225. .entry-meta,
  226. .footer-navigation .footer-menu,
  227. .has-foreground-light-color[class],
  228. .site-branding,
  229. .site-info,
  230. .wp-block-image figcaption,
  231. .wp-block-latest-comments .wp-block-latest-comments__comment-date,
  232. .wp-block-latest-posts .wp-block-latest-posts__post-date,
  233. .wp-block-newspack-blocks-homepage-articles article .cat-links,
  234. .wp-block-newspack-blocks-homepage-articles article .entry-meta,
  235. .wp-block-pullquote .wp-block-pullquote__citation,
  236. .wp-block-pullquote cite,
  237. .wp-block-pullquote footer,
  238. .wp-block-quote .wp-block-quote__citation,
  239. .wp-block-quote cite,
  240. .wp-block-quote footer,
  241. .wp-block-quote.is-large .wp-block-quote__citation,
  242. .wp-block-quote.is-large cite,
  243. .wp-block-quote.is-large footer,
  244. .wp-block-quote.is-style-large .wp-block-quote__citation,
  245. .wp-block-quote.is-style-large cite,
  246. .wp-block-quote.is-style-large footer,
  247. .wp-block-video figcaption,
  248. figcaption', 'color' ),
  249. // Background-color
  250. array( '.wp-block-cover.has-background-dim,
  251. .wp-block-cover-image.has-background-dim,
  252. table.is-style-stripes tbody tr:nth-child(odd),
  253. .wp-block-table.is-style-stripes tbody tr:nth-child(odd),
  254. body .widget_eu_cookie_law_widget #eu-cookie-law.negative', 'background-color' ),
  255. /**
  256. * Utility Classes
  257. */
  258. // Foreground
  259. array( '.has-foreground-color[class]', 'color' ),
  260. array( '.has-foreground-background-color[class]', 'background-color' ),
  261. // Text-color darkened
  262. array( '.has-foreground-dark-color[class]', 'color', '-1' ),
  263. // Background-color darkened
  264. array( '.has-foreground-dark-background-color[class]', 'background-color', '-1' ),
  265. // Text-color brightened
  266. array( '.has-foreground-light-color[class]', 'color', '+2' ),
  267. // Background-color brightened
  268. array( '.has-foreground-light-background-color[class]', 'background-color', '+2' ),
  269. ), __( 'Text Color' ) );
  270. // Accent Color
  271. // $config-global--color-secondary-default
  272. add_color_rule( 'fg1', '#9B6A36', array(
  273. // Text-color
  274. array( '.a8c-posts-list__item .a8c-posts-list-item__meta a:active,
  275. .a8c-posts-list__item .a8c-posts-list-item__meta a:hover,
  276. .comment-meta .comment-metadata a:active,
  277. .comment-meta .comment-metadata a:hover,
  278. .entry-footer a:active,
  279. .entry-footer a:hover,
  280. .entry-meta a:active,
  281. .entry-meta a:hover,
  282. .footer-navigation .footer-menu a:hover,
  283. .main-navigation a:hover,
  284. .site-info a:hover,
  285. .site-title a:hover,
  286. .social-navigation a:hover,
  287. .wp-block-button.is-style-outline .wp-block-button__link.has-focus,
  288. .wp-block-button.is-style-outline .wp-block-button__link:focus,
  289. .wp-block-button.is-style-outline .wp-block-button__link:hover,
  290. .wp-block-button.is-style-outline.wp-block-button__link.has-focus,
  291. .wp-block-button.is-style-outline.wp-block-button__link:focus,
  292. .wp-block-button.is-style-outline.wp-block-button__link:hover,
  293. .wp-block-newspack-blocks-homepage-articles article .cat-links a:active,
  294. .wp-block-newspack-blocks-homepage-articles article .cat-links a:hover,
  295. .wp-block-newspack-blocks-homepage-articles article .entry-meta a:active,
  296. .wp-block-newspack-blocks-homepage-articles article .entry-meta a:hover,
  297. .wp-block-newspack-blocks-homepage-articles article .entry-title a:hover,
  298. a:hover', 'color' ),
  299. // Background-color
  300. array( '.a8c-posts-list__view-all:focus,
  301. .a8c-posts-list__view-all:hover,
  302. .button:focus,
  303. .button:hover,
  304. .has-focus.a8c-posts-list__view-all,
  305. .has-focus.button,
  306. .has-focus.wp-block-button__link,
  307. .has-focus.wp-block-file__button,
  308. .main-navigation #toggle:focus + #toggle-menu,
  309. .wp-block-button__link:focus,
  310. .wp-block-button__link:hover,
  311. .wp-block-file__button:focus,
  312. .wp-block-file__button:hover,
  313. body .widget_eu_cookie_law_widget #eu-cookie-law input.accept:focus,
  314. body .widget_eu_cookie_law_widget #eu-cookie-law input.accept:hover,
  315. body .widget_eu_cookie_law_widget #eu-cookie-law input.has-focus.accept,
  316. button.has-focus,
  317. button:focus,
  318. button:hover,
  319. input.has-focus[type="submit"],
  320. input:focus[type="submit"],
  321. input:hover[type="submit"]', 'background-color' ),
  322. // Border-color
  323. array( 'input[type="color"]:focus,
  324. input[type="date"]:focus,
  325. input[type="datetime"]:focus,
  326. input[type="datetime-local"]:focus,
  327. input[type="email"]:focus,
  328. input[type="month"]:focus,
  329. input[type="number"]:focus,
  330. input[type="password"]:focus,
  331. input[type="range"]:focus,
  332. input[type="search"]:focus,
  333. input[type="tel"]:focus,
  334. input[type="text"]:focus,
  335. input[type="time"]:focus,
  336. input[type="url"]:focus,
  337. input[type="week"]:focus,
  338. textarea:focus', 'border-color' ),
  339. // Text-decoration-color
  340. array( '.entry-content a,
  341. .main-navigation > div > ul > li > a,
  342. .wp-block-newspack-blocks-homepage-articles article .entry-title a,
  343. a', 'text-decoration-color' ),
  344. /**
  345. * Utility Classes
  346. */
  347. // Text-color
  348. array( '.has-secondary-color[class]', 'color' ),
  349. // Background-color
  350. array( '.has-secondary-background-color[class]', 'background-color' ),
  351. ), __( 'Secondary Color' ) );
  352. /**
  353. * Custom CSS
  354. */
  355. function alves_custom_colors_extra_css() { ?>
  356. @media screen and (min-width: 560px) {
  357. .main-navigation > div > ul > li > .sub-menu > li:first-child > a {
  358. border-top: 1px solid;
  359. }
  360. .main-navigation > div > ul > li > .sub-menu > li > a {
  361. border-left: 1px solid;
  362. border-right: 1px solid;
  363. }
  364. .main-navigation > div > ul > li > .sub-menu > li:last-child > a {
  365. border-bottom: 1px solid;
  366. }
  367. .site-header .main-navigation > div > ul > li.current-menu-item > ul::before,
  368. .site-header .main-navigation > div > ul > li.focus > ul::before,
  369. .site-header .main-navigation > div > ul > li:hover > ul::before {
  370. border: none;
  371. }
  372. }
  373. <?php }
  374. add_theme_support( 'custom_colors_extra_css', 'alves_custom_colors_extra_css' );
  375. /**
  376. * Featured Varia Palettes
  377. */
  378. // Light
  379. add_color_palette( array(
  380. '#FFFFFF',
  381. '#1D1E1E',
  382. '#C8133E',
  383. '#4E2F4B',
  384. ), 'Light' );
  385. // Medium
  386. add_color_palette( array(
  387. '#EEF4F7',
  388. '#242527',
  389. '#35845D',
  390. '#233252',
  391. ), 'Medium' );
  392. // Dark
  393. add_color_palette( array(
  394. '#1F2527',
  395. '#FFFFFF',
  396. '#9FD3E8',
  397. '#FBE6AA',
  398. ), 'Dark' );